ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/txtprt_import.h
(Generate patch)

Comparing libgender/txtprt_import.h (file contents):
Revision 1.2 by root, Sun Oct 3 02:29:28 2004 UTC vs.
Revision 1.3 by root, Sun Oct 3 03:03:43 2004 UTC

28 throw txtprt_i_exception ((std::string)"Fileformat invalid, expected '" + c + "' got: '" + o + "' -> '" + line_data.substr (0, 10) + "..."); 28 throw txtprt_i_exception ((std::string)"Fileformat invalid, expected '" + c + "' got: '" + o + "' -> '" + line_data.substr (0, 10) + "...");
29 } 29 }
30 inline void match_achar (char &c) { 30 inline void match_achar (char &c) {
31 std::string s = line_data.substr (0, 1); 31 std::string s = line_data.substr (0, 1);
32 c = s[0]; 32 c = s[0];
33 cout << "Char: " << c << endl;
34 line_data.erase(0, 1); 33 line_data.erase(0, 1);
35 } 34 }
36 35
37 inline void match_space () { match_char (' '); } 36 inline void match_space () { match_char (' '); }
38 inline void match_nl () { match_char ('\n'); } 37 inline void match_nl () { match_char ('\n'); }
39 inline void match_number (double &d) { 38 inline void match_number (double &d) {
40 size_t p = line_data.find_first_not_of ("0123456789.-+"); 39 size_t p = line_data.find_first_not_of ("0123456789.-+e");
41 std::string tmp = line_data.substr (0, p); 40 std::string tmp = line_data.substr (0, p);
42 line_data.erase (0, p); 41 line_data.erase (0, p);
43 d = strtod (tmp.c_str (), NULL); 42 d = strtod (tmp.c_str (), NULL);
44 cout << "NUM: " << d << endl;
45 printf("%f\n", d);
46 } 43 }
47 inline void match_section (char c, std::string &sect) { // c - section char, sect - name of section 44 inline void match_section (char c, std::string &sect) { // c - section char, sect - name of section
48 match_char (c); match_space (); 45 match_char (c); match_space ();
49 size_t p = line_data.find_first_of ("\n"); 46 size_t p = line_data.find_first_of ("\n");
50 sect = line_data.substr (0, p); 47 sect = line_data.substr (0, p);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines