Remove warnings
[anna.git] / include / anna / diameter / codec / basetypes / OctetString.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
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 //
7
8
9 #ifndef anna_diameter_codec_basetypes_OctetString_hpp
10 #define anna_diameter_codec_basetypes_OctetString_hpp
11
12
13 // Local
14 #include <anna/diameter/codec/basetypes/AvpData.hpp>
15
16
17 namespace anna {
18
19 namespace diameter {
20
21 namespace codec {
22
23 class Avp;
24
25 namespace basetypes {
26
27 /**
28 * Diameter OctetString container
29 */
30 class OctetString : public AvpData {
31
32   std::string a_value;
33
34
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);
38
39 protected:
40
41   void assertPrintable() const throw(anna::RuntimeException);
42
43 public:
44
45   virtual ~OctetString() {;}
46
47   // Class-specific ////////////////////////////////////////////////////////////////////////////////////
48   //
49   /**
50   * Gets the OctetString value
51   *
52   * @return OctetString value
53   */
54   const std::string& getValue() const throw() { return a_value; }
55
56   /**
57   * Sets the OctetString value
58   *
59   * @param value OctetString value
60   */
61   void setValue(const std::string& value) throw() { a_value = value; }
62   //
63   //////////////////////////////////////////////////////////////////////////////////////////////////////
64
65
66   // gets
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(); }
70
71
72   // helpers
73
74   // sets
75
76   void decode(const char* buffer, const int size) throw(anna::RuntimeException);
77 };
78
79 }
80 }
81 }
82 }
83
84 #endif