*
* @param ids array with primary identifier in first position, followed by any aliases
*/
- XMLAttribute(const std::vector<std::string>& ids) : Attribute(ids) {}
+ XMLAttribute(const std::vector<std::string>& ids);
/**
* Constructs based on a remoted XMLAttribute.
*
* @param in input object containing marshalled XMLAttribute
*/
- XMLAttribute(DDF& in) : Attribute(in) {
- DDF val = in.first().first();
- while (val.string()) {
- m_values.push_back(val.string());
- val = in.first().next();
- }
- }
+ XMLAttribute(DDF& in);
- virtual ~XMLAttribute() {}
+ virtual ~XMLAttribute();
/**
* Returns the set of values encoded as XML.
*
* @return a mutable vector of the values
*/
- std::vector<std::string>& getValues() {
- return m_values;
- }
+ std::vector<std::string>& getValues();
/**
* Returns the set of values encoded as XML.
*
* @return an immutable vector of the values
*/
- const std::vector<std::string>& getValues() const {
- return m_values;
- }
-
- size_t valueCount() const {
- return m_values.size();
- }
-
- void clearSerializedValues() {
- m_serialized.clear();
- }
-
- const char* getString(size_t index) const {
- return m_values[index].c_str();
- }
-
- void removeValue(size_t index) {
- Attribute::removeValue(index);
- if (index < m_values.size())
- m_values.erase(m_values.begin() + index);
- }
+ const std::vector<std::string>& getValues() const;
+ // Virtual function overrides.
+ size_t valueCount() const;
+ void clearSerializedValues();
+ const char* getString(size_t index) const;
+ void removeValue(size_t index);
const std::vector<std::string>& getSerializedValues() const;
-
- DDF marshall() const {
- DDF ddf = Attribute::marshall();
- ddf.name("XML");
- DDF vlist = ddf.first();
- for (std::vector<std::string>::const_iterator i=m_values.begin(); i!=m_values.end(); ++i)
- vlist.add(DDF(NULL).string(i->c_str()));
- return ddf;
- }
+ DDF marshall() const;
private:
std::vector<std::string> m_values;