contiifstream.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #ifndef __SOT_CONTIIFSTREAM_HH__
11 #define __SOT_CONTIIFSTREAM_HH__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 #include <fstream>
18 #include <sstream>
19 #ifndef WIN32
20 #include <unistd.h>
21 #endif
22 #include <list>
23 
24 #include "sot/core/api.hh"
25 #ifndef WIN32
26 #include <pthread.h>
27 #endif
28 
29 namespace dynamicgraph {
30 namespace sot {
31 
32 /* --------------------------------------------------------------------- */
33 /* --- CLASS ----------------------------------------------------------- */
34 /* --------------------------------------------------------------------- */
36  protected:
37  std::string filename;
38  std::streamoff cursor;
39  static const std::size_t BUFFER_SIZE = 256;
40  char buffer[BUFFER_SIZE];
41  std::list<std::string> reader;
42  bool first;
43 
44  public: /* --- Constructor --- */
45  Contiifstream(const std::string &n = "");
46  ~Contiifstream(void);
47  void open(const std::string &n) {
48  filename = n;
49  cursor = 0;
50  }
51 
52  public: /* --- READ FILE --- */
53  bool loop(void);
54 
55  public: /* --- READ LIST --- */
56  inline bool ready(void) { return 0 < reader.size(); }
57  std::string next(void);
58 };
59 
60 } /* namespace sot */
61 } /* namespace dynamicgraph */
62 
63 #endif /* #ifndef __SOT_CONTIIFSTREAM_HH__ */
dynamicgraph::sot::Contiifstream::open
void open(const std::string &n)
Definition: contiifstream.hh:47
SOT_CORE_EXPORT
#define SOT_CORE_EXPORT
Definition: api.hh:20
dynamicgraph
dynamicgraph::sot::Contiifstream
Definition: contiifstream.hh:35
dynamicgraph::sot::Contiifstream::first
bool first
Definition: contiifstream.hh:42
dynamicgraph::sot::Contiifstream::cursor
std::streamoff cursor
Definition: contiifstream.hh:38
filename
filename
dynamicgraph::sot::Contiifstream::reader
std::list< std::string > reader
Definition: contiifstream.hh:41
dynamicgraph::sot::Contiifstream::ready
bool ready(void)
Definition: contiifstream.hh:56
api.hh
reader
reader
dynamicgraph::sot::Contiifstream::filename
std::string filename
Definition: contiifstream.hh:37
n
Vec3f n


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31