OSDN Git Service

first
[psychlops/cpp.git] / psychlops / core / data / psychlops_d_misc.h
1
2 #ifndef HEADER_PSYCHLOPS_DATA_MISC
3 #define HEADER_PSYCHLOPS_DATA_MISC
4
5 #include <fstream>
6 #include <string>
7 #include <map>
8 #include <vector>
9
10 #include "../ApplicationInterfaces/psychlops_app.h"
11 #include "../devices/psychlops_io_file.h"
12 #include "../graphic/psychlops_graphic.h"
13
14
15 namespace Psychlops {
16
17         class Data;
18
19         class Data_DUMMY2_{};
20         void operator >>(std::istream &a, Data_DUMMY2_ &b);
21
22         class Data {
23
24                 public:
25                 static std::map<const char*, double> number;
26
27
28                 private:
29                 enum DUMMY_ {nullpo};
30                 static DUMMY_ *_tmp;
31                 //typedef unsigned short Data_DUMMY2_;
32                 static Data_DUMMY2_ *dummy2_;
33                 static const int prohibitedcnt = 11;
34                 static char * prohibited[prohibitedcnt];
35
36                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16, class X17, class X18, class X19>
37                 static void _savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16, X17 arg17, X18 arg18, X19 arg19) {
38                         bool c0=false,c1=false,c2=false,c3=false,c4=false,c5=false,c6=false,c7=false,c8=false,c9=false,c10=false,c11=false,c12=false,c13=false,c14=false,c15=false,c16=false,c17=false,c18=false,c19=false;
39                         if(typeid(arg0)!=typeid(_tmp)) c0=true;
40                         if(typeid(arg1)!=typeid(_tmp)) c1=true;
41                         if(typeid(arg2)!=typeid(_tmp)) c2=true;
42                         if(typeid(arg3)!=typeid(_tmp)) c3=true;
43                         if(typeid(arg4)!=typeid(_tmp)) c4=true;
44                         if(typeid(arg5)!=typeid(_tmp)) c5=true;
45                         if(typeid(arg6)!=typeid(_tmp)) c6=true;
46                         if(typeid(arg7)!=typeid(_tmp)) c7=true;
47                         if(typeid(arg8)!=typeid(_tmp)) c8=true;
48                         if(typeid(arg9)!=typeid(_tmp)) c9=true;
49                         if(typeid(arg10)!=typeid(_tmp)) c10=true;
50                         if(typeid(arg11)!=typeid(_tmp)) c11=true;
51                         if(typeid(arg12)!=typeid(_tmp)) c12=true;
52                         if(typeid(arg13)!=typeid(_tmp)) c13=true;
53                         if(typeid(arg14)!=typeid(_tmp)) c14=true;
54                         if(typeid(arg15)!=typeid(_tmp)) c15=true;
55                         if(typeid(arg16)!=typeid(_tmp)) c16=true;
56                         if(typeid(arg17)!=typeid(_tmp)) c17=true;
57                         if(typeid(arg18)!=typeid(_tmp)) c18=true;
58                         if(typeid(arg19)!=typeid(_tmp)) c19=true;
59                         //      filename
60                         std::string filenamechacker = File::decodePath(filename);
61
62                         //output
63                         std::ofstream outport;
64                         outport.open(filenamechacker.c_str());
65 //                      if( outport.fail ) {
66 //                                      outport.open(File::decodePath("%USER_HOME%Saved_%TIME_.txt").c_str());
67 //                              } catch(std::exception e) {
68 //                                      throw Exception(typeid(Data), "", "Failed to save array(s).");
69 //                              }
70 //                      }
71 /*                      try {
72                                 outport.open(filenamechacker.c_str());
73                         } catch(std::exception e) {
74                                 try {
75                                         outport.open(File::decodePath("%USER_HOME%Saved_%TIME_.txt").c_str());
76                                 } catch(std::exception e) {
77                                         throw Exception(typeid(Data), "", "Failed to save array(s).");
78                                 }
79                         }
80 */
81                         outport << AppInfo::expname << std::endl;
82                         outport << header << std::endl;
83                         for(int i=0;i<length;i++) {
84                                 if(c0) { outport << arg0[i]; }
85                                 if(c1) { outport << delimiter << arg1[i]; }
86                                 if(c2) { outport << delimiter << arg2[i]; }
87                                 if(c3) { outport << delimiter << arg3[i]; }
88                                 if(c4) { outport << delimiter << arg4[i]; }
89                                 if(c5) { outport << delimiter << arg5[i]; }
90                                 if(c6) { outport << delimiter << arg6[i]; }
91                                 if(c7) { outport << delimiter << arg7[i]; }
92                                 if(c8) { outport << delimiter << arg8[i]; }
93                                 if(c9) { outport << delimiter << arg9[i]; }
94                                 if(c10) { outport << delimiter << arg10[i]; }
95                                 if(c11) { outport << delimiter << arg11[i]; }
96                                 if(c12) { outport << delimiter << arg12[i]; }
97                                 if(c13) { outport << delimiter << arg13[i]; }
98                                 if(c14) { outport << delimiter << arg14[i]; }
99                                 if(c15) { outport << delimiter << arg15[i]; }
100                                 if(c16) { outport << delimiter << arg16[i]; }
101                                 if(c17) { outport << delimiter << arg17[i]; }
102                                 if(c18) { outport << delimiter << arg18[i]; }
103                                 if(c19) { outport << delimiter << arg19[i]; }
104                                 outport << std::endl;
105                         }
106                         outport.close();
107                 }
108
109                 public:
110                 static char *delimiter;
111
112                 template <class X0>
113                 static void savearray(char *filename, char *header, int length, X0 arg0)
114                 { _savearray(filename, header, length, arg0,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
115                 template <class X0, class X1>
116                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1)
117                 { _savearray(filename, header, length, arg0,arg1,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
118                 template <class X0, class X1, class X2>
119                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2)
120                 { _savearray(filename, header, length, arg0,arg1,arg2,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
121                 template <class X0, class X1, class X2, class X3>
122                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3)
123                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
124                 template <class X0, class X1, class X2, class X3, class X4>
125                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4)
126                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
127                 template <class X0, class X1, class X2, class X3, class X4, class X5>
128                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5)
129                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
130                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6>
131                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6)
132                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
133                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7>
134                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7)
135                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
136                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8>
137                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8)
138                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
139                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9>
140                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9)
141                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
142
143                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10>
144                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10)
145                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
146                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11>
147                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11)
148                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
149                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12>
150                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12)
151                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
152                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13>
153                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13)
154                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,_tmp,_tmp,_tmp,_tmp,_tmp,_tmp); }
155                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14>
156                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14)
157                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,_tmp,_tmp,_tmp,_tmp,_tmp); }
158                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15>
159                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15)
160                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,_tmp,_tmp,_tmp,_tmp); }
161                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16>
162                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16)
163                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,_tmp,_tmp,_tmp); }
164                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16, class X17>
165                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16, X17 arg17)
166                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,_tmp,_tmp); }
167                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16, class X17, class X18>
168                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16, X17 arg17, X18 arg18)
169                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,_tmp); }
170                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16, class X17, class X18, class X19>
171                 static void savearray(char *filename, char *header, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16, X17 arg17, X18 arg18, X19 arg19)
172                 { _savearray(filename, header, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19); }
173
174                 static std::ofstream output;
175
176
177                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16, class X17, class X18, class X19>
178                 static void _loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16, X17 arg17, X18 arg18, X19 arg19) {
179                         bool c0=false,c1=false,c2=false,c3=false,c4=false,c5=false,c6=false,c7=false,c8=false,c9=false,c10=false,c11=false,c12=false,c13=false,c14=false,c15=false,c16=false,c17=false,c18=false,c19=false;
180                         if(typeid(arg0)!=typeid(dummy2_)) c0=true;
181                         if(typeid(arg1)!=typeid(dummy2_)) c1=true;
182                         if(typeid(arg2)!=typeid(dummy2_)) c2=true;
183                         if(typeid(arg3)!=typeid(dummy2_)) c3=true;
184                         if(typeid(arg4)!=typeid(dummy2_)) c4=true;
185                         if(typeid(arg5)!=typeid(dummy2_)) c5=true;
186                         if(typeid(arg6)!=typeid(dummy2_)) c6=true;
187                         if(typeid(arg7)!=typeid(dummy2_)) c7=true;
188                         if(typeid(arg8)!=typeid(dummy2_)) c8=true;
189                         if(typeid(arg9)!=typeid(dummy2_)) c9=true;
190                         if(typeid(arg10)!=typeid(dummy2_)) c10=true;
191                         if(typeid(arg11)!=typeid(dummy2_)) c11=true;
192                         if(typeid(arg12)!=typeid(dummy2_)) c12=true;
193                         if(typeid(arg13)!=typeid(dummy2_)) c13=true;
194                         if(typeid(arg14)!=typeid(dummy2_)) c14=true;
195                         if(typeid(arg15)!=typeid(dummy2_)) c15=true;
196                         if(typeid(arg16)!=typeid(dummy2_)) c16=true;
197                         if(typeid(arg17)!=typeid(dummy2_)) c17=true;
198                         if(typeid(arg18)!=typeid(dummy2_)) c18=true;
199                         if(typeid(arg19)!=typeid(dummy2_)) c19=true;
200
201                         //      filename
202                         std::string filenamechacker = File::decodePath(filename);
203
204                         //input
205                         char buf[256];
206                         //char delimiter;
207                         std::ifstream inport(filenamechacker.c_str());
208                         if( inport.fail() ) {
209                                 throw Exception(typeid(Data), "", "Specified file is not found.");
210                         }
211                         for(int i=0; i<skip_lines; i++) inport.getline(buf,256);
212                         for(int i=0;i<length;i++) {
213                                 if(c0) { inport >> arg0[i]; }
214                                 if(c1) { inport >> arg1[i]; }
215                                 if(c2) { inport >> arg2[i]; }
216                                 if(c3) { inport >> arg3[i]; }
217                                 if(c4) { inport >> arg4[i]; }
218                                 if(c5) { inport >> arg5[i]; }
219                                 if(c6) { inport >> arg6[i]; }
220                                 if(c7) { inport >> arg7[i]; }
221                                 if(c8) { inport >> arg8[i]; }
222                                 if(c9) { inport >> arg9[i]; }
223                                 if(c10) { inport >> arg10[i]; }
224                                 if(c11) { inport >> arg11[i]; }
225                                 if(c12) { inport >> arg12[i]; }
226                                 if(c13) { inport >> arg13[i]; }
227                                 if(c14) { inport >> arg14[i]; }
228                                 if(c15) { inport >> arg15[i]; }
229                                 if(c16) { inport >> arg16[i]; }
230                                 if(c17) { inport >> arg17[i]; }
231                                 if(c18) { inport >> arg18[i]; }
232                                 if(c19) { inport >> arg19[i]; }
233                         }
234                         inport.close();
235                 }
236
237                 template <class X0>
238                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0)
239                 { _loadarray(filename, skip_lines, length, arg0,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
240                 template <class X0, class X1>
241                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1)
242                 { _loadarray(filename, skip_lines, length, arg0,arg1,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
243                 template <class X0, class X1, class X2>
244                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2)
245                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
246                 template <class X0, class X1, class X2, class X3>
247                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3)
248                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
249                 template <class X0, class X1, class X2, class X3, class X4>
250                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4)
251                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
252                 template <class X0, class X1, class X2, class X3, class X4, class X5>
253                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5)
254                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
255                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6>
256                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6)
257                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
258                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7>
259                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7)
260                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
261                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8>
262                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8)
263                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
264                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9>
265                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9)
266                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
267
268                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10>
269                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10)
270                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
271                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11>
272                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11)
273                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
274                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12>
275                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12)
276                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
277                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13>
278                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13)
279                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
280                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14>
281                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14)
282                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,dummy2_,dummy2_,dummy2_,dummy2_,dummy2_); }
283                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15>
284                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15)
285                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,dummy2_,dummy2_,dummy2_,dummy2_); }
286                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16>
287                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16)
288                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,dummy2_,dummy2_,dummy2_); }
289                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16, class X17>
290                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16, X17 arg17)
291                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,dummy2_,dummy2_); }
292                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16, class X17, class X18>
293                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16, X17 arg17, X18 arg18)
294                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,dummy2_); }
295                 template <class X0, class X1, class X2, class X3, class X4, class X5, class X6, class X7, class X8, class X9, class X10, class X11, class X12, class X13, class X14, class X15, class X16, class X17, class X18, class X19>
296                 static void loadarray(char *filename, int skip_lines, int length, X0 arg0, X1 arg1, X2 arg2, X3 arg3, X4 arg4, X5 arg5, X6 arg6, X7 arg7, X8 arg8, X9 arg9, X10 arg10, X11 arg11, X12 arg12, X13 arg13, X14 arg14, X15 arg15, X16 arg16, X17 arg17, X18 arg18, X19 arg19)
297                 { _loadarray(filename, skip_lines, length, arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19); }
298
299
300
301                 static int loadCSVraw(const std::string& filename, std::vector<std::vector<std::string> >& lines);
302                 static int parseCSV(const std::string& csvSource, std::vector<std::vector<std::string> >& lines);
303
304                 static int loadCSV(const std::string& filename, double** data)
305                 {
306                         std::vector<std::vector<std::string> > lines;
307                         loadCSVraw(filename, lines);
308                         for(int i=0; i<lines.size(); i++) {
309                                 for(int j=0; j<lines[i].size(); j++) {
310                                         data[i][j] = atof( lines[i][j].c_str() );
311                                 }
312                         }
313             return lines.size();
314                 }
315         };
316
317
318
319
320 }       /*      <- namespace Psycholops         */
321
322
323 #endif