- IdCard card;
- IdCard[] cards;
-
- bool
- check_stack (SList<string> stack, string[] reference)
- {
- if (stack.length () < reference.length)
- return false;
-
- for (int i = 0; i<reference.length; i++)
- {
- if (stack.nth_data(i) != reference[i])
- return false;
- }
-
- return true;
- }
-
- bool
- always_confirm_handler (SList<string> stack)
- {
- string[] always_confirm_path = {"always-confirm", "rule", "selection-rules", "identity", "identities"};
-
- return check_stack (stack, always_confirm_path);
- }
-
- bool
- pattern_handler (SList<string> stack)
- {
- string[] pattern_path = {"pattern", "rule", "selection-rules", "identity", "identities"};
-
- return check_stack (stack, pattern_path);
- }
-
- bool
- server_cert_handler (SList<string> stack)
- {
- string[] server_cert_path = {"server-cert", "trust-anchor", "identity", "identities"};
-
- return check_stack (stack, server_cert_path);
- }
-
- bool
- subject_alt_handler (SList<string> stack)
- {
- string[] subject_alt_path = {"subject-alt", "trust-anchor", "identity", "identities"};
-
- return check_stack (stack, subject_alt_path);
- }
-
- bool
- subject_handler (SList<string> stack)
- {
- string[] subject_path = {"subject", "trust-anchor", "identity", "identities"};
-
- return check_stack (stack, subject_path);
- }
-
- bool
- ca_cert_handler (SList<string> stack)
- {
- string[] ca_path = {"ca-cert", "trust-anchor", "identity", "identities"};
-
- return check_stack (stack, ca_path);
- }
-
- bool
- realm_handler (SList<string> stack)
- {
- string[] realm_path = {"realm", "identity", "identities"};
-
- return check_stack (stack, realm_path);
- }
-
- bool
- password_handler (SList<string> stack)
- {
- string[] password_path = {"password", "identity", "identities"};
-
- return check_stack (stack, password_path);
- }
-
- bool
- user_handler (SList<string> stack)
- {
- string[] user_path = {"user", "identity", "identities"};
-
- return check_stack (stack, user_path);
- }
-
- bool
- display_name_handler (SList<string> stack)
- {
- string[] display_name_path = {"display-name", "identity", "identities"};
-
- return check_stack (stack, display_name_path);
- }
-
- public void
- start_element_func (MarkupParseContext context,
- string element_name,
- string[] attribute_names,
- string[] attribute_values) throws MarkupError
- {
- if (element_name == "identity")
- {
- IdCard[] tmp_cards = cards;
-
- cards = new IdCard[tmp_cards.length + 1];
- for (int i=0; i<tmp_cards.length; i++)
- {
- cards[i] = tmp_cards[i];
- }
- card = new IdCard();
- cards[tmp_cards.length] = card;
- }
- else if (element_name == "rule")
- {
- Rule[] tmp_rules = card.rules;
- card.rules = new Rule[tmp_rules.length + 1];
- for (int i=0; i<tmp_rules.length; i++)
- {
- card.rules[i] = tmp_rules[i];
- }
-
- card.rules[tmp_rules.length] = Rule();
- }
- }