Пример #1
0
ULDAPEntry::ULDAPEntry(int num_names, const char** names, int num_entry)
{
   U_TRACE_REGISTER_OBJECT(0, ULDAPEntry, "%d,%p,%d", num_names, names, num_entry)

   U_INTERNAL_ASSERT_EQUALS(names[num_names], 0)

   U_DUMP_ATTRS(names)

   n_attr    = num_names;
   n_entry   = num_entry;
   attr_name = names;

   dn       =    (char**) UMemoryPool::_malloc(num_entry,             sizeof(char*),    true);
   attr_val = (UString**) UMemoryPool::_malloc(num_entry * num_names, sizeof(UString*), true);
}
Пример #2
0
void USOAPParser::startElement(const XML_Char* name, const XML_Char** attrs)
{
   U_TRACE(0, "USOAPParser::startElement(%S,%p)", name, attrs)

   U_DUMP_ATTRS(attrs)

   UXMLAttribute* attribute;
   UString str((void*)name), namespaceName, accessorName, value;

   UXMLElement::splitNamespaceAndName(str, namespaceName, accessorName);

   if (flag_state == 0)
      {
      U_INTERNAL_ASSERT(u_rmatch(U_STRING_TO_PARAM(str), U_CONSTANT_TO_PARAM(":Envelope")))

      flag_state = 1;
      }

   U_DUMP("flag_state = %d ptree = %p ptree->parent() = %p ptree->numChild() = %u ptree->depth() = %u",
           flag_state, ptree, ptree->parent(), ptree->numChild(), ptree->depth())

   current = U_NEW(UXMLElement(str, accessorName, namespaceName));
   ptree   = ptree->push(current);

   if (flag_state <= 2)
      {
      if (flag_state == 1 &&
          u_rmatch(U_STRING_TO_PARAM(str), U_CONSTANT_TO_PARAM(":Header")))
         {
         header     = ptree;
         flag_state = 2;
         }
      else if (u_rmatch(U_STRING_TO_PARAM(str), U_CONSTANT_TO_PARAM(":Body")))
         {
         body       = ptree;
         flag_state = 3;
         }
      }

   U_INTERNAL_DUMP("flag_state = %d", flag_state)

   while (*attrs)
      {
        str.replace(*attrs++);
      value.replace(*attrs++);

      UXMLElement::splitNamespaceAndName(str, namespaceName, accessorName);

      attribute = U_NEW(UXMLAttribute(str, accessorName, namespaceName, value));

      current->addAttribute(attribute);

      // check if anybody has mustUnderstand set to true

      if (flag_state == 2 &&
          accessorName.equal(U_CONSTANT_TO_PARAM("mustUnderstand")))
         {
         envelope.mustUnderstand = value.equal(U_CONSTANT_TO_PARAM("true"));

         U_INTERNAL_DUMP("envelope.mustUnderstand = %b", envelope.mustUnderstand)
         }

      // set the name of namespace qualified element information (gSOAP)

      if (flag_state == 1                                   &&
          namespaceName.equal(U_CONSTANT_TO_PARAM("xmlns")) &&
           accessorName == *UString::str_ns)
         {
         envelope.nsName = value;

         U_INTERNAL_DUMP("envelope.nsName = %V", envelope.nsName.rep)
         }