STK++ 0.9.13
Data Management

The DManager project propose classes and functions for managing the data. More...

Namespaces

namespace  STK::Import
 The import namespace contains the constants and global functions used in the DManager project when importing data in STK containers.
 

Classes

class  STK::KernelHandler
 implementation of the DataHandlerBase class for kernel mixture models. More...
 
class  STK::CellBase< Type >
 template Base class for the Cell in a list . More...
 
class  STK::CellVe< Type >
 template class for the Vertical Cell of a Vertical List. More...
 
class  STK::CellHo< Type >
 template class for the Horizontal Cell of a Horizontal List. More...
 
class  STK::Cell2D< Type >
 template class for the 2 Dimensional Cells. More...
 
class  STK::CvHandler
 CvHanler is an utility function for building the submatrix/subvectors needed when using k-folds cross-validation. More...
 
class  STK::DataFrame
 DataFrame is a List of Variable with the same number of rows. More...
 
class  STK::DataHandler
 implementation of the DataHandlerBase class using ReadWriteCsv and Array2D. More...
 
class  STK::DataHandlerBase< Derived >
 A class derived from a DataHandlerBase allows to store various data sets identified by an idData and an idModel. More...
 
class  STK::ExportToCsv
 Export data to a Csv. More...
 
class  STK::IDataBridge
 Interface class wrapping a data set. More...
 
class  STK::IDataHandler
 A DataHandler class allow to store various data set identified with an idData (a string). More...
 
class  STK::ImportFromCsv
 import data from a Csv File in a DataFrame. More...
 
class  STK::IPage
 A IPage is an interface base class for reading and/or writing a page of option in a file. More...
 
class  STK::IVariable
 IVariable is an Interface class for all Variables classes. More...
 
class  STK::List1D< Type_ >
 template One dimensional Horizontal List. More...
 
class  STK::Option
 the Option class allow to store the value of an option from a IPage. More...
 
class  STK::PartitionHandler
 CvHanler is an utility function for building the submatrix/subvectors needed when creating learning and test data sets. More...
 
class  STK::TReadWriteCsv< Type >
 the TReadWriteCsv class : allow to write and/or to read a csv file. More...
 
class  STK::ReadWritePages
 The ReadWritePages class allow to handle a file of option containing pages. More...
 
class  STK::Variable< Type_ >
 Variable is an implementation of the Base class IVariable using The Array1D class for storing the data. More...
 

Enumerations

enum  STK::DManager::TypeDataFile { STK::DManager::unknown_ =0 , STK::DManager::csv_ }
 type of the data file we handle. More...
 
enum  STK::Import::TypeImport {
  STK::Import::unknown_ =0 , STK::Import::numeric_ , STK::Import::only_numeric_ , STK::Import::string_ ,
  STK::Import::directed_ , STK::Import::intelligent_
}
 define the type of import we want to perform. More...
 
enum  STK::Option::TypeOption {
  STK::Option::unknown_ =0 , STK::Option::string_ , STK::Option::real_ , STK::Option::integer_ ,
  STK::Option::range_ , STK::Option::lstring_ , STK::Option::lreal_ , STK::Option::linteger_ ,
  STK::Option::lrange_ , STK::Option::page_
}
 A TypeOption is the kind of options that can read or write a program in a file. More...
 
enum  STK::Csv::readflags { STK::Csv::RW_APPEND_DATA = 0x00000004 , STK::Csv::RW_REPLACE_DATA = 0x00000008 }
 TODO: These flags determine the behavior of the reading methods. More...
 

Functions

TypeDataFile STK::DManager::stringToTypeDataFile (String const &type)
 convert a String to a TypeDataFile.
 
String STK::DManager::TypeDataFileToString (TypeDataFile const &type)
 convert a TypeDataFile to a String.
 
bool STK::DManager::checkStringToBoolean (String const &str)
 check if a string represent a boolean.
 
bool STK::DManager::StringToBoolean (String const &str)
 convert a string to a boolean.
 
void STK::DManager::removeCharBeforeAndAfter (String &str, Char c)
 remove all occurrences of the char c at the beginning and the end of the string str.
 
istreamSTK::DManager::getField (istream &is, String &value, Char delimiter)
 Get the current field from the input stream.
 
template<class TYPE >
void STK::DManager::readList (String const &strBuffer, std::list< TYPE > &lst, Char sep=CHAR_SEP)
 Read a list of value of type TYPE stored in a line.
 
template<class TYPE >
void STK::DManager::writeList (ostream &os, std::list< TYPE > const &lst, Char sep=CHAR_SEP)
 Write a list of value of type TYPE stored in a line.
 
int STK::DManager::nbEndOfLine (istream &is)
 
template<class Vector >
void STK::heapSort (Vector &T)
 Sort the container T in ascending order.
 
template<class Vector >
void STK::heapSort (Vector const &T, Vector &Tsort)
 Sort the container T in ascending order and return the result in the container Tsort.
 
template<class Vector , class VectorInt >
void STK::heapSort (VectorInt &I, Vector const &T)
 Sort the container T in ascending order using index array.
 
template<class Vector , class VectorInt >
void STK::applySort1D (Vector &T, VectorInt const &I)
 Apply a sorting index array to the 1D container T.
 
template<class Array , class VectorInt >
void STK::applySort2D (Array &T, VectorInt const &I)
 Apply a sorting index array to the 2D container T row by row.
 
TypeImport STK::Import::stringToTypeImport (String const &type)
 Convert a String to a TypeImport.
 

Detailed Description

The DManager project propose classes and functions for managing the data.

The DManager project contains all the class related to data management. It provides

Enumeration Type Documentation

◆ readflags

TODO: These flags determine the behavior of the reading methods.

Enumerator
RW_APPEND_DATA 
RW_REPLACE_DATA 

Definition at line 87 of file STK_ReadWriteCsv.h.

88 {
89 RW_APPEND_DATA = 0x00000004,
90 RW_REPLACE_DATA = 0x00000008
91 };

◆ TypeDataFile

type of the data file we handle.

Enumerator
unknown_ 

unknown reduction

csv_ 

Definition at line 82 of file STK_DManager_Util.h.

83{
85 unknown_ =0
87 , csv_
88};
@ unknown_
unknown reduction

◆ TypeImport

define the type of import we want to perform.

Enumerator
unknown_ 

try to convert the columns in numeric values and let the others as string

numeric_ 

try to convert the columns in numeric values and let the others as string

only_numeric_ 

conserve only the columns with numeric values

string_ 

copy the columns

directed_ 

convert using an array of conversion.

intelligent_ 

try to convert with the most appropriate format the columns. NOT implemented

Definition at line 51 of file STK_Import_Util.h.

52 {
54 unknown_ =0,
60 string_,
65 };
@ numeric_
try to convert the columns in numeric values and let the others as string
@ only_numeric_
conserve only the columns with numeric values
@ intelligent_
try to convert with the most appropriate format the columns. NOT implemented
@ string_
copy the columns
@ directed_
convert using an array of conversion.

◆ TypeOption

A TypeOption is the kind of options that can read or write a program in a file.

It can be:

  • a String (e.g. toto)
  • a Real (e.g. 3.14159)
  • an int (e.g. 101)
  • a Range of number (e.g. 2:10)
  • a list of String
  • a list of Real
  • a list of int
  • a list of Range
  • a sub-page
Enumerator
unknown_ 
string_ 

characters

real_ 

floating

integer_ 

discrete number

range_ 

range of number

lstring_ 

list of strings separated by commas

lreal_ 

list of floating numbers separated by commas

linteger_ 

list of discrete numbers separated by commas

lrange_ 

list of range of number separated by commas

page_ 

a page option

Definition at line 71 of file STK_Option.h.

72 {
73 unknown_ =0,
74 string_,
75 real_,
76 integer_,
77 range_,
78 lstring_,
79 lreal_,
80 linteger_,
81 lrange_,
82 page_
83 };
@ linteger_
list of discrete numbers separated by commas
Definition STK_Option.h:80
@ page_
a page option
Definition STK_Option.h:82
@ range_
range of number
Definition STK_Option.h:77
@ lstring_
list of strings separated by commas
Definition STK_Option.h:78
@ lreal_
list of floating numbers separated by commas
Definition STK_Option.h:79
@ integer_
discrete number
Definition STK_Option.h:76
@ lrange_
list of range of number separated by commas
Definition STK_Option.h:81
@ string_
characters
Definition STK_Option.h:74
@ real_
floating
Definition STK_Option.h:75

Function Documentation

◆ applySort1D()

template<class Vector , class VectorInt >
void STK::applySort1D ( Vector T,
VectorInt const I 
)

Apply a sorting index array to the 1D container T.

Parameters
Ithe index array sorting T
Tthe container to sort

Definition at line 287 of file STK_HeapSort.h.

288{
291#ifdef STK_BOUNDS_CHECK
292 if (I.range() != T.range())
293 { STKRUNTIME_ERROR_2ARG(applySort1D,I.range(),T.range(),incompatible lengths);}
294#endif
295 Vector A(T.range());
296 for (int i=I.begin(); i< I.end(); i++) { A[i] = T[I[i]];}
297 T.move(A);
298}
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
Definition STK_Macros.h:120
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)
Array2DVector< Real > Vector
final class for a Real vertical container.

References STK::applySort1D(), STK::IArray2D< Derived >::move(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKRUNTIME_ERROR_2ARG.

Referenced by STK::applySort1D(), STK::applySort2D(), and STK::Stat::Univariate< TContainer1D, Real >::compOrderStatistics().

◆ applySort2D()

template<class Array , class VectorInt >
void STK::applySort2D ( Array &  T,
VectorInt const I 
)

Apply a sorting index array to the 2D container T row by row.

Parameters
Ithe index array sorting T
Tthe container to sort

Definition at line 306 of file STK_HeapSort.h.

307{
309#ifdef STK_BOUNDS_CHECK
310 if (I.range() != T.rows())
311 { STKRUNTIME_ERROR_2ARG(applySort1D,I.range(),T.rows(),incompatible lengths);}
312#endif
313 Array A(T.rows(), T.cols());
314 for (int i=I.begin(); i< I.end(); i++) { A.row(i) = T.row(I[i]);}
315 T.move(A);
316}

References STK::applySort1D(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKRUNTIME_ERROR_2ARG.

◆ checkStringToBoolean()

bool STK::DManager::checkStringToBoolean ( String const str)

check if a string represent a boolean.

A String is a boolean if it is written "TRUE" or "FALSE". There is no need to use upper case.

Parameters
strthe string to check
Returns
true if the String i a boolean, false otherwise.

Definition at line 78 of file STK_DManager_Util.cpp.

79{
80 // is it TRUE ?
81 if (toUpperString(str) == _T("TRUE")) { return true;}
82 // is it FALSE ?
83 if (toUpperString(str) == _T("FALSE")) { return true;}
84 // not a bolean string
85 return false;
86}
#define _T(x)
Let x unmodified.
String const & toUpperString(String &s)
convert the characters of the String to upper case
Definition STK_String.h:134

References _T, and STK::toUpperString().

◆ getField()

istream & STK::DManager::getField ( istream is,
String value,
Char  delimiter 
)

Get the current field from the input stream.

A field is between the current position and a delimiter or an end of line in the stream. All blank spaces and tabulations before and after the field are removed.

Parameters
isthe stream to treat
valuethe value of the field
delimiterthe delimiter of the current field
Returns
the input stream without the value extracted

Definition at line 124 of file STK_DManager_Util.cpp.

125{
126 std::getline( is, value, delimiter);
127 removeCharBeforeAndAfter(value, CHAR_BLANK);
128 removeCharBeforeAndAfter(value, CHAR_TAB);
129 return is;
130}
void removeCharBeforeAndAfter(String &str, Char c)
remove all occurrences of the char c at the beginning and the end of the string str.

References STK::DManager::removeCharBeforeAndAfter().

Referenced by STK::TReadWriteCsv< Type >::read(), STK::DManager::readList(), and STK::TReadWriteCsv< Type >::readNames().

◆ heapSort() [1/3]

template<class Vector >
void STK::heapSort ( Vector T)

Sort the container T in ascending order.

Parameters
Tthe container to sort

Definition at line 50 of file STK_HeapSort.h.

51{
53 typedef typename hidden::Traits<Vector>::Type Type;
54 // number of elements
55 const int nb_elt = T.size();
56 if (nb_elt < 2) return;
57
58 // if the container is base one, shift0 = 0 and shift1 = 1
59 int shift1 = T.begin(), shift0 = T.begin() - 1;
60
61 // create heap
62 for (int first = nb_elt/2; first > 0; -- first)
63 {
64 // the value value to insert in the heap
65 Type value = T[shift0 + first];
66 // organize the heap
67 int i=first, j=2*first;
68 while (j <= nb_elt)
69 {
70 // j+1 is greatest child
71 if ( j < nb_elt && T[shift0 + j] < T[shift1 + j] ) j++;
72 // we have find a child gt value
73 if (value >= T[shift0 + j]) break;
74 // else shift the inner value
75 T[shift0 + i] = T[shift0 + j];
76 // go down in the tree
77 i = j;
78 j*= 2;
79 }
80 // plug value in its final location
81 T[shift0 + i] = value;
82 }
83#ifdef STK_HEAPSORT_DEBUG
84 std::cout << "T=\n" << T.asDerived() << _T("\n";);
85#endif
86 // sort T
87 for (int last = nb_elt;;)
88 { // the value to sort
89 Type value = T[shift0 + last];
90 // Put the top of the heap at the end
91 T[shift0 + last] = T[shift1];
92 // decrease last. last==1 : we end the job
93 if (--last == 1)
94 { T[shift1] = value;
95 break;
96 }
97 // organize the heap
98 int i=1, j=2;
99 while (j <= last)
100 { // j+1 is greatest child
101 if ( j < last && T[shift0 + j] < T[shift1 + j] ) j++;
102 // we have find a child gt value
103 if (value >= T[shift0 + j]) break;
104 // else shift the inner value
105 T[shift0 + i] = T[shift0 + j];
106 // go down in the tree
107 i = j;
108 j*= 2;
109 }
110 // plug value in its final location
111 T[shift0 + i] = value;
112 }
113}

References _T, and STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.

Referenced by STK::Stat::Univariate< TContainer1D, Real >::compOrderStatistics().

◆ heapSort() [2/3]

template<class Vector >
void STK::heapSort ( Vector const T,
Vector Tsort 
)

Sort the container T in ascending order and return the result in the container Tsort.

Parameters
Tthe container to sort
Tsortthe container with the result

Definition at line 122 of file STK_HeapSort.h.

123{
125 typedef typename Vector::Type Type;
126 // copy T in Tsort
127 Tsort = T.asDerived();
128 // number of elements
129 const int nb_elt = Tsort.size();
130 if (nb_elt < 2) return;
131
132 // if the container is base one, shift0 = 0 and shift1 = 1
133 int shift1 = Tsort.begin(), shift0 = Tsort.begin() - 1;
134
135 // create heap
136 for (int first = nb_elt/2; first > 0; -- first)
137 {
138 // the value value to insert in the heap
139 Type value = Tsort[shift0 + first];
140 // organize the heap
141 int i=first, j=2*first;
142 while (j <= nb_elt)
143 {
144 // j+1 is greatest child
145 if ( j < nb_elt && Tsort[shift0 + j] < Tsort[shift1 + j] ) j++;
146 // we have find a child gt value
147 if (value >= Tsort[shift0 + j]) break;
148 // else shift the inner value
149 Tsort[shift0 + i] = Tsort[shift0 + j];
150 // go down in the tree
151 i = j;
152 j*= 2;
153 }
154 // plug value in its final location
155 Tsort[shift0 + i] = value;
156 }
157#ifdef STK_HEAPSORT_DEBUG
158 std::cout << "T=\n" << Tsort << _T("\n";);
159#endif
160 // sort T
161 for (int last = nb_elt;;)
162 { // the value to sort
163 Type value = Tsort[shift0 + last];
164 // Put the top of the heap at the end
165 Tsort[shift0 + last] = Tsort[shift1];
166 // decrease last. last==1 : we end the job
167 if (--last == 1)
168 { Tsort[shift1] = value;
169 break;
170 }
171 // organize the heap
172 int i=1, j=2;
173 while (j <= last)
174 { // j+1 is greatest child
175 if ( j < last && Tsort[shift0 + j] < Tsort[shift1 + j] ) j++;
176 // we have find a child gt value
177 if (value >= Tsort[shift0 + j]) break;
178 // else shift the inner value
179 Tsort[shift0 + i] = Tsort[shift0 + j];
180 // go down in the tree
181 i = j;
182 j*= 2;
183 }
184 // plug value in its final location
185 Tsort[shift0 + i] = value;
186 }
187}

References _T, and STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.

◆ heapSort() [3/3]

template<class Vector , class VectorInt >
void STK::heapSort ( VectorInt I,
Vector const T 
)

Sort the container T in ascending order using index array.

T is not modified, I contain the indices of the elements of T in ascending order.

Parameters
Ithe index array sorting T
Tthe container to sort

Definition at line 197 of file STK_HeapSort.h.

198{
201 typedef typename hidden::Traits<Vector>::Type Type;
202
203 // number of elements
204 int nb_elt = T.size();
205
206 // create index array
207 I.asDerived().resize(T.range());
208 int first = I.begin(), last = I.lastIdx();
209 for (int i=first; i<=last; i++)
210 { I[i] = i;}
211
212 if (nb_elt < 2) return;
213
214 // if the container is base one, shift0 = 0 and shift1 = 1
215 int shift1 = T.begin(), shift0 = T.begin() - 1;
216
217 // create heap
218 for (first = nb_elt/2; first > 0; --first)
219 {
220 // the value value to insert in the heap
221 Type value = T[I[shift0 + first]];
222 // organize the heap
223 int i=first, j=2*first;
224 while (j <= nb_elt)
225 {
226 // j+1 is greatest child
227 if ( j < nb_elt && T[I[shift0 + j]] < T[I[shift1 + j]] ) j++;
228 // we have find a child lt value
229 if (value >= T[I[shift0 + j]]) break;
230 // else shift the inner values
231 I[shift0 + i] = I[shift0 + j];
232 // go down in the tree
233 i = j;
234 j*= 2;
235 }
236 // plug value in its final location
237 I[shift0 + i] = shift0 + first;
238 }
239#ifdef STK_HEAPSORT_DEBUG
240 std::cout << "I=\n" << I <<"\n";
241#endif
242 // sort T
243 for (int last = nb_elt;;)
244 {
245 // the value to sort
246 int ivalue = I[shift0 + last];
247 Type value = T[ivalue];
248 // Put the top of the heap at the end
249 //T[shift0 + last] = T[shift1];
250 I[shift0 + last] = I[shift1];
251 // decrease last. last==1 : we end the job
252 if (--last == 1)
253 { //T[shift1] = value;
254 I[shift1] = ivalue;
255 break;
256 }
257 // organize the heap
258 int i=1, j=2;
259 while (j <= last)
260 { // j+1 is greatest child
261 if ( j < last && T[I[shift0 + j]] < T[I[shift1 + j]] ) j++;
262 // we have find a child gt value
263 if (value >= T[I[shift0 + j]]) break;
264 // else shift the inner value
265 // T[shift0 + i] = T[shift0 + j];
266 I[shift0 + i] = I[shift0 + j];
267 // go down in the tree
268 i = j;
269 j*= 2;
270 }
271 // plug value in its final location
272 // T[shift0 + i] = value;
273 I[shift0 + i] = ivalue;
274 }
275#ifdef STK_HEAPSORT_DEBUG
276 std::cout << "I=\n" << I <<"\n";
277#endif
278}

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.

◆ nbEndOfLine()

int STK::DManager::nbEndOfLine ( istream is)
Returns
the number of line in an istream
Parameters
isthe stream to parse.

Definition at line 136 of file STK_DManager_Util.cpp.

137{
138 char last = CHAR_BLANK;
139 TestEndOfLineOp test(&last);
140 int nbLine = std::count_if( std::istreambuf_iterator<Char>( is )
141 , std::istreambuf_iterator<Char>(),
142 test
143 );
144 if (last != CHAR_NL) nbLine++;
145#ifdef STK_DEBUG
146 stk_cout << _T("In nbEndOfLine, nbLine = ") << nbLine << _T("\n");
147#endif
148 return nbLine;
149}
#define stk_cout
Standard stk output stream.

References _T, and stk_cout.

Referenced by STK::TReadWriteCsv< Type >::initRead().

◆ readList()

template<class TYPE >
void STK::DManager::readList ( String const strBuffer,
std::list< TYPE > &  lst,
Char  sep = CHAR_SEP 
)

Read a list of value of type TYPE stored in a line.

Parameters
strBufferthe string with the list of value
lstthe resulting list
septhe separator character

Definition at line 153 of file STK_DManager_Util.h.

154{
155 // Declare an input string stream
156 istringstream instream;
157 // Use strBuffer as source of input.
158 instream.str(strBuffer);
159 // read the line
160 do
161 {
162 // get field
163 String strbuff;
164 getField(instream, strbuff, sep);
165 // check if it is a blank field
166 if (strbuff.empty()) { break;}
167 // append Data to the list
168 TYPE value;
169 if (stringToType(value, strbuff))
170 lst.push_back(value);
171 // TODO: else emit warning or Exception
172 }
173 while(1);
174}
bool stringToType(Type &t, String const &s, std::ios_base &(*f)(std::ios_base &)=std::dec)
convert a String to Type
Definition STK_String.h:195
istream & getField(istream &is, String &value, Char delimiter)
Get the current field from the input stream.
std::basic_string< Char > String
STK fundamental type of a String.
std::basic_istringstream< Char > istringstream
istringstream for Char
Definition STK_Stream.h:63

References STK::DManager::getField(), and STK::stringToType().

Referenced by STK::Option::setValue().

◆ removeCharBeforeAndAfter()

void STK::DManager::removeCharBeforeAndAfter ( String str,
Char  c 
)

remove all occurrences of the char c at the beginning and the end of the string str.

Parameters
strthe string to treat
cthe character to remove before and after

Definition at line 108 of file STK_DManager_Util.cpp.

109{
110 // erase first whitespaces
111 str.erase(0, str.find_first_not_of(c));
112 // erase remaining whitespaces
113 size_t found =str.find_last_not_of(c);
114 if (found != str.npos)
115 str.erase(found+1);
116 else
117 str.clear(); // str is all whitespace
118}

Referenced by STK::IPage::findKeyword(), STK::DManager::getField(), STK::IPage::processLine(), STK::IPage::read(), and STK::TReadWriteCsv< Type >::readCurrentLine().

◆ StringToBoolean()

bool STK::DManager::StringToBoolean ( String const str)

convert a string to a boolean.

A String is a boolean if it is written "TRUE" or "FALSE". There is no need to use upper case.

Parameters
strthe string to convert
Returns
true if the String is "TRUE, false otherwise.

Definition at line 96 of file STK_DManager_Util.cpp.

97{
98 // is it TRUE ?
99 if (toUpperString(str) == _T("TRUE")) { return true;}
100 // if it's not true, it's false
101 return false;
102}

References _T, and STK::toUpperString().

◆ stringToTypeDataFile()

TypeDataFile STK::DManager::stringToTypeDataFile ( String const type)

convert a String to a TypeDataFile.

Parameters
typethe String we want to convert
Returns
the TypeDataFile represented by the String type. if the string does not match any known name, the unknown_ type is returned.

Definition at line 52 of file STK_DManager_Util.cpp.

53{
54 if (toUpperString(type) == toUpperString(_T("csv"))) return csv_;
55 return unknown_;
56}

References _T, STK::DManager::csv_, STK::toUpperString(), and STK::DManager::unknown_.

◆ stringToTypeImport()

TypeImport STK::Import::stringToTypeImport ( String const type)

Convert a String to a TypeImport.

Parameters
typethe String we want to convert
Returns
the TypeImport represented by the String type. if the string does not match any known name, the unknown_ type is returned.

Definition at line 50 of file STK_Import_Util.cpp.

51{
52 if (toUpperString(type) == toUpperString(_T("unknown"))) return unknown_;
53 if (toUpperString(type) == toUpperString(_T("numeric"))) return numeric_;
54 if (toUpperString(type) == toUpperString(_T("only_numeric"))) return only_numeric_;
55 if (toUpperString(type) == toUpperString(_T("string"))) return string_;
56 if (toUpperString(type) == toUpperString(_T("directed"))) return directed_;
57 if (toUpperString(type) == toUpperString(_T("intelligent"))) return intelligent_;
58 return unknown_;
59}

References _T, STK::Import::directed_, STK::Import::intelligent_, STK::Import::numeric_, STK::Import::only_numeric_, STK::Import::string_, STK::toUpperString(), and STK::Import::unknown_.

◆ TypeDataFileToString()

String STK::DManager::TypeDataFileToString ( TypeDataFile const type)

convert a TypeDataFile to a String.

Parameters
typethe type of data file we want to convert
Returns
the string associated to this type.

Definition at line 63 of file STK_DManager_Util.cpp.

64{
65 if (type == csv_) return String(_T("csv"));
66 return String(_T("unknown"));
67}

References _T, and STK::DManager::csv_.

◆ writeList()

template<class TYPE >
void STK::DManager::writeList ( ostream os,
std::list< TYPE > const lst,
Char  sep = CHAR_SEP 
)

Write a list of value of type TYPE stored in a line.

Parameters
osthe output stream
lstthe list to write
septhe separator character

Definition at line 183 of file STK_DManager_Util.h.

184{
185 if (lst.empty()) return;
186 typename std::list<TYPE>::const_iterator it = lst.begin();
187 os << *it;
188 it++;
189 for ( ; it != lst.end(); it++)
190 { os << sep << CHAR_BLANK << *it;}
191}

Referenced by STK::Option::write().