37 #ifndef ACADO_TOOLKIT_ACADO_IO_UTILS_HPP 38 #define ACADO_TOOLKIT_ACADO_IO_UTILS_HPP 89 const std::string& destination,
90 const std::string& commentString,
91 bool printCodegenNotice =
false 96 const std::string& destination,
97 const std::string& commentString,
98 bool printCodegenNotice =
false 119 const std::string& commentString
139 copy(array.begin(), array.end(), ostream_iterator< T >(stream,
"\t"));
146 vector< vector<T> >& array
149 typename vector< vector< T > >::iterator it;
150 for (it = array.begin(); it != array.end(); ++it)
152 copy(it->begin(), it->end(), ostream_iterator< T >(stream,
"\t"));
164 while (stream.good() ==
true)
167 getline(stream, line);
169 if (line[ 0 ] ==
'/' || line[ 0 ] ==
'#' || line.empty())
172 stringstream ss( line );
175 array.push_back( val );
184 vector< vector< T > >& array
187 while (stream.good() ==
true)
191 getline(stream, line);
193 if (line[ 0 ] ==
'/' || line[ 0 ] ==
'#' || line.empty())
196 stringstream ss( line );
197 copy(istream_iterator< T >( ss ), istream_iterator< T >(), back_inserter( data ));
200 array.push_back( data );
207 template<
typename T >
222 void set( streamsize _precision, streamsize _width, ios_base::fmtflags _flags)
224 stream.precision( _precision );
244 #endif // ACADO_TOOLKIT_ACADO_IO_UTILS_HPP
const char DEFAULT_END_STRING[4]
USING_NAMESPACE_ACADO typedef TaylorVariable< Interval > T
const uint DEFAULT_PRECISION
returnValue acadoPrintAutoGenerationNotice(std::ofstream &stream, const std::string &commentString)
Allows to pass back messages to the calling function.
const char DEFAULT_COL_SEPARATOR[2]
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
string toString(T const &value)
const char NOT_A_NUMBER[3]
#define CLOSE_NAMESPACE_ACADO
const char DEFAULT_START_STRING[3]
returnValue acadoPrintCopyrightNotice()
BEGIN_NAMESPACE_ACADO const char LINE_SEPARATOR
returnValue acadoCopyFile(const std::string &source, const std::string &destination, const std::string &commentString, bool printCodegenNotice=false)
returnValue acadoCopyTemplateFile(const std::string &source, const std::string &destination, const std::string &commentString, bool printCodegenNotice=false)
const char TEXT_SEPARATOR
returnValue acadoCreateFolder(const std::string &name)
const char DEFAULT_ROW_SEPARATOR[6]
istream & operator>>(istream &stream, vector< T > &array)
#define BEGIN_NAMESPACE_ACADO
const char DEFAULT_LABEL[1]
returnValue getGlobalStringDefinitions(PrintScheme _printScheme, char **_startString, char **_endString, uint &_width, uint &_precision, char **_colSeparator, char **_rowSeparator)
ostream & operator<<(ostream &stream, vector< T > &array)