Minsky
dataSpecSchema.h
Go to the documentation of this file.
1 /*
2  @copyright Steve Keen 2018
3  @author Russell Standish
4  This file is part of Minsky.
5 
6  Minsky is free software: you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Minsky is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Minsky. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef DATASPECSCHEMA_H
21 #define DATASPECSCHEMA_H
22 #include <set>
23 #include <vector>
24 #include <math.h>
25 
26 namespace minsky
27 {
29  {
30  // these fields are only used for persistence. Need to be handled specially within schema code
32  std::size_t numCols=0;
33 
34  // NB escape character might be backslash ('\\'), but not usually used in CSV files, so set to nul.
35  char separator=',', quote='"', escape='\0', decSeparator='.';
36  bool mergeDelimiters=false;
37  bool counter=false;
38  bool dontFail=false;
39  double missingValue=nan("");
41  std::size_t headerRow=0;
42  std::string horizontalDimName="?";
43  civita::Dimension horizontalDimension;
44 
48 
50  std::set<unsigned> dimensionCols, dataCols;
51  std::vector<civita::Dimension> dimensions;
52  std::vector<std::string> dimensionNames;
53  };
54 }
55 
56 #include "dataSpecSchema.cd"
57 #include "dataSpecSchema.xcd"
58 #endif
DuplicateKeyAction duplicateKeyAction
DuplicateKeyAction
what to do with duplicate keys
std::size_t numCols
number of columns in CSV. Must be > dataColOffset
civita::Dimension horizontalDimension
std::vector< civita::Dimension > dimensions
bool counter
count data items, not read their values
std::string horizontalDimName
bool dontFail
do not throw an error on corrupt data
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky&#39;s state cha...
Definition: constMap.h:22
std::size_t headerRow
number of header rows
std::vector< std::string > dimensionNames
std::set< unsigned > dataCols
std::set< unsigned > dimensionCols
rows and columns that are comment lines to be ignored