ANNA Suite  2020b
Multipurpose development suite for Telco applications
EncodedData.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_EncodedData_hpp
10 #define anna_core_util_EncodedData_hpp
11 
12 #include <openssl/des.h>
13 
14 #include <anna/core//DataBlock.hpp>
15 
16 namespace anna {
17 
18 namespace xml {
19 class Node;
20 }
21 
22 class Encoder;
23 
27 class EncodedData {
28 public:
32  EncodedData() : a_value(true), a_realSize(0) {;}
33 
41  void initialize(const xml::Node* document) noexcept(false);
42 
49  xml::Node* asXML(xml::Node* parent) const noexcept(false);
50 
51 private:
52  DES_key_schedule a_skey [3];
53  DES_cblock a_iv;
54  DataBlock a_value;
55  int a_realSize;
56 
57  EncodedData(const EncodedData&);
58 
59  static const std::string& asBCD(const DataBlock&, std::string&) ;
60  static int fromBCD(const std::string&, DataBlock&) ;
61 
62  friend class Encoder;
63 };
64 
65 
66 }
67 
68 #endif
Definition: Node.hpp:56
Definition: EncodedData.hpp:27
xml::Node Node
Definition: Node.hpp:21
Definition: app.hpp:12
EncodedData()
Definition: EncodedData.hpp:32
Definition: DataBlock.hpp:24
Definition: Encoder.hpp:26