00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "freStatisticValueDefinition.h"
00023 #include "freConvert.h"
00024
00025 namespace FREE
00026 {
00027
00031
00032 StatisticValueDefinition&
00033 StatisticValueDefinition::
00034 operator = (const StatisticValueDefinition& rEntry)
00035 {
00036 if (this != &rEntry)
00037 {
00038 this->Reset();
00039 SetRefID(rEntry.GetRefID());
00040 SetIDPath(rEntry.GetIDPath());
00041 SetName(rEntry.GetName());
00042 SetDescription(rEntry.GetDescription());
00043 SetType(rEntry.GetType());
00044 };
00045
00046 return *this;
00047 };
00048
00049 StatisticValueDefinition::
00050 StatisticValueDefinition():XMLStreamObject(XMLTags::StatisticValueDefinition)
00051 {
00052 Reset();
00053 };
00054
00055 StatisticValueDefinition::
00056 ~StatisticValueDefinition()
00057 {};
00058
00059 void
00060 StatisticValueDefinition::
00061 Reset()
00062 {
00063 XMLStreamObject::Reset();
00064 m_sName = "";
00065 m_sDescription = "";
00066 m_sType = "";
00067 m_sIDPath = "";
00068 m_RefID = 0;
00069 };
00070
00071 void
00072 StatisticValueDefinition::
00073 SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData)
00074 {
00075 if (rsXMLSubTag == XMLTags::StatisticValueDefName) m_sName = rsXMLSubData;
00076 else if (rsXMLSubTag == XMLTags::StatisticValueDefDescription) m_sDescription = rsXMLSubData;
00077 else if (rsXMLSubTag == XMLTags::StatisticValueDefType) m_sType = rsXMLSubData;
00078 else if (rsXMLSubTag == XMLTags::StatisticValueDefIDPath) m_sIDPath = rsXMLSubData;
00079 else if (rsXMLSubTag == XMLTags::StatisticValueReference) m_RefID = Convert::ToInt(rsXMLSubData);
00080 };
00081
00082 std::string
00083 StatisticValueDefinition::
00084 SaveData(const unsigned int& iDepth, bool& bHasSubElements) const
00085 {
00086 std::string result;
00087 AddSubElement(result, XMLTags::StatisticValueReference, Convert::ToStr(m_RefID), iDepth);
00088 AddSubElement(result, XMLTags::StatisticValueDefName, m_sName, iDepth);
00089 AddSubElement(result, XMLTags::StatisticValueDefType, m_sType, iDepth);
00090 AddSubElement(result, XMLTags::StatisticValueDefIDPath, m_sIDPath, iDepth);
00091 AddSubElement(result, XMLTags::StatisticValueDefDescription, m_sDescription, iDepth);
00092
00093 return result;
00094 };
00095
00096 }