VirtualBox

Changeset 33469 in vbox for trunk/src


Ignore:
Timestamp:
Oct 26, 2010 1:43:40 PM (14 years ago)
Author:
vboxsync
Message:

IPRT: xml classes documentation, plus reduced some buffer sizes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r33464 r33469  
    468468}
    469469
     470/**
     471 * Private implementation.
     472 * @param elmRoot
     473 */
    470474void Node::buildChildren(const ElementNode &elmRoot)       // private
    471475{
     
    646650}
    647651
     652/**
     653 * Private element constructor.
     654 * @param pelmRoot
     655 * @param pParent
     656 * @param plibNode
     657 */
    648658ElementNode::ElementNode(const ElementNode *pelmRoot,
    649659                         Node *pParent,
     
    9991009
    10001010/**
    1001  * Sets the given attribute.
     1011 * Sets the given attribute; overloaded version for const char *.
    10021012 *
    10031013 * If an attribute with the given name exists, it is overwritten,
     
    10431053}
    10441054
     1055/**
     1056 * Sets the given attribute; overloaded version for int32_t.
     1057 *
     1058 * If an attribute with the given name exists, it is overwritten,
     1059 * otherwise a new attribute is created. Returns the attribute node
     1060 * that was either created or changed.
     1061 *
     1062 * @param pcszName
     1063 * @param i
     1064 * @return
     1065 */
    10451066AttributeNode* ElementNode::setAttribute(const char *pcszName, int32_t i)
    10461067{
    1047     char szValue[64];
     1068    char szValue[10];
    10481069    RTStrPrintf(szValue, sizeof(szValue), "%RI32", i);
    10491070    AttributeNode *p = setAttribute(pcszName, szValue);
     
    10511072}
    10521073
     1074/**
     1075 * Sets the given attribute; overloaded version for uint32_t.
     1076 *
     1077 * If an attribute with the given name exists, it is overwritten,
     1078 * otherwise a new attribute is created. Returns the attribute node
     1079 * that was either created or changed.
     1080 *
     1081 * @param pcszName
     1082 * @param u
     1083 * @return
     1084 */
    10531085AttributeNode* ElementNode::setAttribute(const char *pcszName, uint32_t u)
    10541086{
    1055     char szValue[64];
     1087    char szValue[10];
    10561088    RTStrPrintf(szValue, sizeof(szValue), "%RU32", u);
    10571089    AttributeNode *p = setAttribute(pcszName, szValue);
     
    10591091}
    10601092
     1093/**
     1094 * Sets the given attribute; overloaded version for int64_t.
     1095 *
     1096 * If an attribute with the given name exists, it is overwritten,
     1097 * otherwise a new attribute is created. Returns the attribute node
     1098 * that was either created or changed.
     1099 *
     1100 * @param pcszName
     1101 * @param i
     1102 * @return
     1103 */
    10611104AttributeNode* ElementNode::setAttribute(const char *pcszName, int64_t i)
    10621105{
    1063     char szValue[64];
     1106    char szValue[20];
    10641107    RTStrPrintf(szValue, sizeof(szValue), "%RI64", i);
    10651108    AttributeNode *p = setAttribute(pcszName, szValue);
     
    10671110}
    10681111
     1112/**
     1113 * Sets the given attribute; overloaded version for uint64_t.
     1114 *
     1115 * If an attribute with the given name exists, it is overwritten,
     1116 * otherwise a new attribute is created. Returns the attribute node
     1117 * that was either created or changed.
     1118 *
     1119 * @param pcszName
     1120 * @param u
     1121 * @return
     1122 */
    10691123AttributeNode* ElementNode::setAttribute(const char *pcszName, uint64_t u)
    10701124{
    1071     char szValue[64];
     1125    char szValue[20];
    10721126    RTStrPrintf(szValue, sizeof(szValue), "%RU64", u);
    10731127    AttributeNode *p = setAttribute(pcszName, szValue);
     
    10751129}
    10761130
     1131/**
     1132 * Sets the given attribute to the given uint32_t, outputs a hexadecimal string.
     1133 *
     1134 * If an attribute with the given name exists, it is overwritten,
     1135 * otherwise a new attribute is created. Returns the attribute node
     1136 * that was either created or changed.
     1137 *
     1138 * @param pcszName
     1139 * @param u
     1140 * @return
     1141 */
    10771142AttributeNode* ElementNode::setAttributeHex(const char *pcszName, uint32_t u)
    10781143{
    1079     char szValue[64];
     1144    char szValue[10];
    10801145    RTStrPrintf(szValue, sizeof(szValue), "0x%RX32", u);
    10811146    AttributeNode *p = setAttribute(pcszName, szValue);
     
    10831148}
    10841149
     1150/**
     1151 * Sets the given attribute; overloaded version for bool.
     1152 *
     1153 * If an attribute with the given name exists, it is overwritten,
     1154 * otherwise a new attribute is created. Returns the attribute node
     1155 * that was either created or changed.
     1156 *
     1157 * @param pcszName
     1158 * @param i
     1159 * @return
     1160 */
    10851161AttributeNode* ElementNode::setAttribute(const char *pcszName, bool f)
    10861162{
     
    10891165
    10901166/**
    1091  * Private constructur for a new attribute node. This one is special:
     1167 * Private constructor for a new attribute node. This one is special:
    10921168 * in ppcszKey, it returns a pointer to a string buffer that should be
    10931169 * used to index the attribute correctly with namespaces.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette