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 //
9 #ifndef anna_diameter_codec_basetypes_OctetString_hpp
10 #define anna_diameter_codec_basetypes_OctetString_hpp
14 #include <anna/diameter/codec/basetypes/AvpData.hpp>
28 * Diameter OctetString container
30 class OctetString : public AvpData {
35 // Mandatory for basic diameter type:
36 void codeBasic(char* buffer, int &size) throw(anna::RuntimeException);
37 void setPrintableString(const char * printableString) throw(anna::RuntimeException);
41 void assertPrintable() const throw(anna::RuntimeException);
45 virtual ~OctetString() {;}
47 // Class-specific ////////////////////////////////////////////////////////////////////////////////////
50 * Gets the OctetString value
52 * @return OctetString value
54 const std::string& getValue() const throw() { return a_value; }
57 * Sets the OctetString value
59 * @param value OctetString value
61 void setValue(const std::string& value) throw() { a_value = value; }
63 //////////////////////////////////////////////////////////////////////////////////////////////////////
67 // virtual for Unknown format container
68 virtual std::string getFormatName() const throw() { return "OctetString"; }
69 virtual int getSize() const throw() { return a_value.size(); }
76 void decode(const char* buffer, const int size) throw(anna::RuntimeException);