Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

IOUtils.H

Go to the documentation of this file.
00001 
00010 #ifndef IOUTILS_H
00011 #define IOUTILS_H
00012 
00013 #define OUTSIDE_GLUE_CORE
00014 #include <std/strings.H>
00015 #include <mlib/points.H>
00016 
00017 #include <Color.H>
00018 #include "streamwrap.H"
00019 
00020 class IOUTILS
00021 {
00022 public:
00023 
00024   // INPUT:
00025 
00026   // return the next non-blank, non-commented line
00027   // returns str_ptr::null_str() if reaches the end of the file
00028   static str_ptr readln(istream *is);
00029 
00030   // returns data contained in { } in the input str
00031   static str_ptr getBracketedStr(str_ptr in);
00032   static int     getBracketedInt(str_ptr in);
00033   static double  getBracketedDouble(str_ptr in);
00034   static Wpt     getBracketedWpt(str_ptr in);
00035   static Wvec    getBracketedWvec(str_ptr in);
00036   static Color   getBracketedColor(str_ptr in);
00037 
00038   // returns data contained in { } in the next line of the istream
00039   static str_ptr getBracketedStr(istream *is);
00040   static int     getBracketedInt(istream *is);
00041   static double  getBracketedDouble(istream *is);
00042   static Wpt     getBracketedWpt(istream *is);
00043   static Wvec    getBracketedWvec(istream *is);
00044   static Wtransf getBracketedWtransf(istream *is);
00045   static Color   getBracketedColor(istream *is);
00046 
00047   // same as above, but reads a list of data separated by commas and line breaks
00048   static str_list       getBracketedStrList(istream *is);
00049   static ARRAY<int>     getBracketedIntList(istream *is);
00050   static ARRAY<double>  getBracketedDoubleList(istream *is);
00051   static Wpt_list       getBracketedWptList(istream *is);
00052   static ARRAY<Wvec>    getBracketedWvecList(istream *is);
00053   static ARRAY<Wtransf> getBracketedWtransfList(istream *is);
00054   static ARRAY<Color>   getBracketedColorList(istream *is);
00055 
00056   // OUTPUT:
00057 
00058   static void writeBracketed(ostream *os, str_ptr token, str_ptr s);
00059   static void writeBracketed(ostream *os, str_ptr token, int i);
00060   static void writeBracketed(ostream *os, str_ptr token, double d);
00061   static void writeBracketed(ostream *os, str_ptr token, Wpt p);
00062   static void writeBracketed(ostream *os, str_ptr token, Wvec v);
00063   static void writeBracketed(ostream *os, str_ptr token, Wtransf m);
00064   static void writeBracketed(ostream *os, str_ptr token, Color c);
00065 
00066   static void writeBracketed(ostream *os, str_ptr token, str_list sl);
00067   static void writeBracketed(ostream *os, str_ptr token, ARRAY<int> il);
00068   static void writeBracketed(ostream *os, str_ptr token, ARRAY<double> dl);
00069   static void writeBracketed(ostream *os, str_ptr token, Wpt_list wl);
00070   static void writeBracketed(ostream *os, str_ptr token, ARRAY<Wvec> wl);
00071   static void writeBracketed(ostream *os, str_ptr token, ARRAY<Wtransf> wl);
00072   static void writeBracketed(ostream *os, str_ptr token, ARRAY<Color> cl);
00073   
00074 };
00075 
00076 
00077 #endif

Generated on Mon Sep 15 16:27:55 2003 for inspace by doxygen1.2.18