PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
data_stream_write_file.h
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #ifndef __DATA_STREAM_WRITE_FILE_H__
8 #define __DATA_STREAM_WRITE_FILE_H__
9 
10 #include "data_stream_include.h"
12 
14 template<typename T>
15 struct DataStream<FILE*, DataStreamMode::WRITE, std::vector<T> >{
17 
21  static bool data_stream(FILE* & ds, std::vector<T> & data){
22  //Save the size of the data
23  size_t nbElement(data.size());
25  if(nbElement == 0lu || !b){return b;} //If there is no element, quit now
26 
27 // if(data_stream_isSimpleType<T>()){
28 // b &= DataStream<FILE*, DataStreamMode::WRITE, T>::data_stream_tab(ds, (T*)data.data(), nbElement);
29 // }else{
30  for(typename std::vector<T>::iterator it(data.begin()); it != data.end(); ++it){
32  }
33 // }
34  return b;
35  }
36 };
37 
39 template<typename T>
40 struct DataStream<FILE*, DataStreamMode::WRITE, std::list<T> >{
42 
46  static bool data_stream(FILE* & ds, std::list<T> & data){
47  //Save the size of the data
48  size_t nbElement(data.size());
50  if(nbElement == 0lu || !b){return b;} //If there is no element, quit now
51  for(typename std::list<T>::iterator it(data.begin()); it != data.end(); ++it){
53  }
54  return b;
55  }
56 };
57 
59 template<typename T, typename U>
60 struct DataStream<FILE*, DataStreamMode::WRITE, std::map<T, U> >{
62 
66  static bool data_stream(FILE* & ds, std::map<T, U> & data){
67  //Save the size of the data
68  size_t nbElement(data.size());
70  if(nbElement == 0lu || !b){return b;} //If there is no element, quit now
71  for(typename std::map<T, U>::iterator it(data.begin()); it != data.end(); ++it){
74  }
75  return b;
76  }
77 };
78 
80 template<typename T, typename U>
81 struct DataStream<FILE*, DataStreamMode::WRITE, std::pair<T, U> >{
83 
87  static bool data_stream(FILE* & ds, std::pair<T, U> & data){
90  return b;
91  }
92 };
93 
94 
95 
96 #endif
97 
98 
static bool data_stream(FILE *&ds, std::list< T > &data)
Get the size of a class std::list T.
static bool data_stream(FILE *&ds, std::map< T, U > &data)
Get the size of a class std::list T.
static bool data_stream(FILE *&ds, std::pair< T, U > &data)
Get the size of a class std::list T.
static bool data_stream(FILE *&ds, std::vector< T > &data)
Get the size of a class std::vector T.
Generic DataStream class.
static bool data_stream(Stream &ds, T &data)
Dummy function to catch if a type is not specialised.