ANNA Suite  2020b
Multipurpose development suite for Telco applications
Encoder.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_core_util_Encoder_hpp
10 #define anna_core_util_Encoder_hpp
11 
13 #include <anna/core//DataBlock.hpp>
16 
18 
19 namespace anna {
20 
26 class Encoder {
27 public:
31  Encoder() {;}
32 
39  const EncodedData& encode(const char* text) noexcept(false) {
40  DataBlock aux(text, anna_strlen(text) + 1, false);
41  return encode(aux);
42  }
43 
50  const EncodedData& encode(const std::string& text) noexcept(false) {
51  return encode(text.c_str());
52  }
53 
59  const EncodedData& encode(const DataBlock& data) noexcept(false);
60 
69  const DataBlock& decode(const EncodedData& data) noexcept(false);
70 
74  static void initialize() ;
75 
76 private:
77  EncodedData a_data;
78 
79  DataBlock& setDataBlock(const DataBlock& other) noexcept(false);
80 
81 };
82 
83 }
84 
85 #endif
const EncodedData & encode(const std::string &text) noexcept(false)
Definition: Encoder.hpp:50
Encoder()
Definition: Encoder.hpp:31
const EncodedData & encode(const char *text) noexcept(false)
Definition: Encoder.hpp:39
#define anna_strlen(a)
Definition: defines.hpp:50
const DataBlock & decode(const EncodedData &data) noexcept(false)
Definition: EncodedData.hpp:27
Definition: app.hpp:12
static void initialize()
Definition: DataBlock.hpp:24
Definition: Encoder.hpp:26