ANNA Suite  2020b
Multipurpose development suite for Telco applications
OctetString.hpp
Go to the documentation of this file.
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
15 
16 
17 namespace anna {
18 
19 namespace diameter {
20 
21 namespace codec {
22 
23 class Avp;
24 
25 namespace basetypes {
26 
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) noexcept(false);
37  void setPrintableString(const char * printableString) noexcept(false);
38 
39 protected:
40 
41  void assertPrintable() const noexcept(false);
42 
43 public:
44 
45  virtual ~OctetString() {;}
46 
47  // Class-specific ////////////////////////////////////////////////////////////////////////////////////
48  //
54  const std::string& getValue() const { return a_value; }
55 
61  void setValue(const std::string& value) { a_value = value; }
62  //
64 
65 
66  // gets
67  // virtual for Unknown format container
68  virtual std::string getFormatName() const { return "OctetString"; }
69  virtual int getSize() const { return a_value.size(); }
70 
71 
72  // helpers
73 
74  // sets
75 
76  void decode(const char* buffer, const int size) noexcept(false);
77 };
78 
79 }
80 }
81 }
82 }
83 
84 #endif
virtual ~OctetString()
Definition: OctetString.hpp:45
virtual std::string getFormatName() const
Definition: OctetString.hpp:68
Definition: OctetString.hpp:30
void decode(const char *buffer, const int size) noexcept(false)
virtual int getSize() const
Definition: OctetString.hpp:69
Definition: app.hpp:12
const std::string & getValue() const
Definition: OctetString.hpp:54
void assertPrintable() const noexcept(false)
void setValue(const std::string &value)
Definition: OctetString.hpp:61