1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
10 #include <anna/diameter/stack/Vendor.hpp>
12 #include <anna/core/functions.hpp>
13 #include <anna/xml/xml.hpp>
15 //using namespace anna;
17 anna_assign_enum(anna::diameter::stack::Vendor::Code) = { "Ietf", "Nokia", "Ericsson", "3GPP", "Telefonicaid", "Etsi", NULL /* list end indicator */};
19 //------------------------------------------------------------------------------
20 //----------------------------------------------------------- Vendor::asString()
21 //------------------------------------------------------------------------------
22 std::string anna::diameter::stack::Vendor::asString(void) const throw() {
28 trace += anna::functions::asString(a_id);
34 //------------------------------------------------------------------------------
35 //-------------------------------------------------------------- Vendor::asXML()
36 //------------------------------------------------------------------------------
37 anna::xml::Node* anna::diameter::stack::Vendor::asXML(anna::xml::Node* parent) const throw() {
38 // <!ELEMENT vendor EMPTY>
39 // <!ATTLIST vendor name CDATA #REQUIRED code CDATA #REQUIRED>
40 anna::xml::Node* result = parent->createChild("vendor");
41 result->createAttribute("name", a_name);
42 result->createAttribute("code", anna::functions::asString(a_id));