23 #ifndef UNV_Utilities_HeaderFile
24 #define UNV_Utilities_HeaderFile
46 static std::string GetPrefix();
56 assert (in_file.good());
57 assert (!ds_name.empty());
59 std::string olds, news;
64 in_file >> olds >> news;
69 while( ((olds !=
"-1") || (news ==
"-1")))
74 if ( in_file.eof() || in_file.fail() )
95 inline double D_to_e(std::string& number)
101 const size_t position = number.find(
"D",6);
102 if ( position != std::string::npos )
103 number.replace(position, 1,
"e");
105 return atof (number.c_str());
115 std::ifstream in_stream(theFileName.c_str());
118 std::string olds, news;
119 while (!in_stream.eof()){
121 std::getline(in_stream, news,
'\n');
123 return (olds ==
" -1");
133 inline std::string
read_line(std::ifstream& in_stream,
const bool next=
true)
136 std::getline( in_stream, resLine );
138 std::getline( in_stream, resLine );
140 if ( resLine.size() > 0 && resLine[ resLine.size()-1 ] ==
'\r' )
141 resLine.resize( resLine.size()-1 );
149 #define MESSAGE(msg) std::cout<<__FILE__<<"["<<__LINE__<<"]::"<<msg<<endl;
151 #define BEGMSG(msg) std::cout<<UNV::PrefixPrinter::GetPrefix()<<msg
153 #define ADDMSG(msg) std::cout<<msg
160 #define EXCEPTION(TYPE, MSG) {\
161 std::ostringstream aStream;\
162 aStream<<__FILE__<<"["<<__LINE__<<"]::"<<MSG;\
163 throw TYPE(aStream.str());\
#define MESHDRIVERUNV_EXPORT
Definition: SMESH_DriverUNV.hxx:37
Definition: UNV_Utilities.hxx:40
static int myCounter
Definition: UNV_Utilities.hxx:41
Definition: UNV_Utilities.hxx:36
double D_to_e(std::string &number)
Method for converting exponential notation from "D" to "e", for example 3.141592654D+00 --> 3....
Definition: UNV_Utilities.hxx:95
bool check_file(const std::string theFileName)
Definition: UNV_Utilities.hxx:113
bool beginning_of_dataset(std::istream &in_file, const std::string &ds_name)
Definition: UNV_Utilities.hxx:54
const size_t theMaxLineLen
Definition: UNV_Utilities.hxx:38
std::string read_line(std::ifstream &in_stream, const bool next=true)
reads a whole line
Definition: UNV_Utilities.hxx:133