1 // SSName.cpp: implementation of the SSName class.
3 //////////////////////////////////////////////////////////////////////
7 //#include "SSDatabase.h"
10 //////////////////////////////////////////////////////////////////////
11 // Construction/Destruction
12 //////////////////////////////////////////////////////////////////////
14 SSName::SSName(SSNAME ssname
, SSNamesCache
* pNameService
)
16 m_pNamesService (pNameService
)
18 // if (!m_pNamesService && SSDatabase::GetCurrentDatabase ())
19 // m_pNamesService = SSDatabase::GetCurrentDatabase ()->GetNamesService ();
27 //---------------------------------------------------------------------------
28 long SSName::GetOffset () const
30 return m_ssName
.nsmap
;
33 //---------------------------------------------------------------------------
34 std::string
SSName::GetType () const
36 switch (m_ssName
.flags
)
43 return "type unknown";
46 //---------------------------------------------------------------------------
47 std::string
SSName::GetFullName () const
49 std::string name
= m_ssName
.name
;
50 if (m_pNamesService
&& m_ssName
.nsmap
!= NULL
)
52 std::string altName
= m_pNamesService
->GetName (m_ssName
.flags
, m_ssName
.nsmap
);
53 if (!altName
.empty ())
59 //---------------------------------------------------------------------------
60 std::ostream
& operator<<(std::ostream
& os
, const SSName
& ssname
)
62 os
<< ssname
.GetFullName ();
67 // ---------------------------------------------------------------
68 void SSName::ToXml (XMLNode
* pParent
, std::string name
/*= "SSName"*/)
70 std::stringstream stream
;
71 stream
<< GetOffset ();
73 map
["type"] = GetType ();
74 map
["offset"] = stream
.str();
75 XMLElement
node (pParent
, name
, map
, GetFullName ());