EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoArchiveTXT.h
Go to the documentation of this file.
1 
6 #if !defined(_EOARCHIVETXT_H)
7 #define _EOARCHIVETXT_H
8 
9 #include "eoArchive.h"
10 
11 #include <iostream>
12 #include <fstream>
13 #include <sstream>
14 #include <string>
15 #include <string.h>
16 #include <map>
17 
19 #define _ARCHIVE_TYPE_NAME "_HUMAN_ARCHIVE\0"
20 #define _ARCHIVE_VER_MAJOR 0
22 #define _ARCHIVE_VER_MINOR 4
24 
32 typedef std::map<std::string, std::string> parsed_Items;
33 class eoArchiveTXT: public eoArchive
34 {
35 public:
36  eoArchiveTXT();
37 
38  virtual ~eoArchiveTXT();
39 
40  virtual eoArchive& operator &(char const *obj);
41  virtual eoArchive& operator &(char *obj);
42 // virtual eoArchive& operator &(int &obj);
43  virtual eoArchive& operator &(uint32_t &obj);
44  virtual eoArchive& operator &(int32_t &obj);
45  virtual eoArchive& operator &(uint16_t &obj);
46  virtual eoArchive& operator &(int16_t &obj);
47  virtual eoArchive& operator &(uint8_t &obj);
48  virtual eoArchive& operator &(int8_t &obj);
49  virtual eoArchive& operator &(double& obj);
50  virtual eoArchive& operator &(bool &obj);
51  virtual eoArchive& operator &(eoISerialize *obj);
52  virtual eoArchive& operator &(eoISerialize &obj);
57  void ExchangeInt(int &obj);
58 
59  virtual uint8_t Open(const char * strBuf);
60  virtual void Close();
61 
62 
63  void indent();
64  void startBlock();
65  void endBlock();
66 
67  void startBlock(const char* BlockName);
68 private:
69  std::fstream myFile;
70 
71  // identifier for the current Level...
72  std::string curName;
73 
74  bool newBlock;
75  parsed_Items blockItems;
76  eoReturn ParseFile();
77  eoReturn ParseBlock(std::string blockName);
78  static std::ostream& indent(std::ostream &s, uint8_t level);
79  static std::ostream& startBlock(std::ostream &s, uint8_t level);
80  static std::ostream& endBlock(std::ostream &s, uint8_t level);
81 
82 };
86 #endif
contains base for Archives
Interface for storing.
Definition: eoISerialize.h:48
virtual void Close()
Archive for Human readable Text files.
Definition: eoArchiveTXT.h:33
eoReturn
contains all the return values from different functions
Definition: eoApiDef.h:40
virtual eoArchive & operator&(char const *obj)
void startBlock()
uint8_t level
Actual level of the serialisation stream.
Definition: eoArchive.h:151
void endBlock()
void ExchangeInt(int &obj)
the base Archive
Definition: eoArchive.h:46
virtual uint8_t Open(const char *strBuf)