00001
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "CTB.hxx"
00015 #include "CTBline.hxx"
00016
00024
00026
00027 CTBline::CTBline()
00028 : mb_streamvalid(true),
00029 m_stream("",0),
00030 mb_continue(false),
00031 mc_comment(0),
00032 mb_trimwhite(false),
00033 mb_tolower(false),
00034 mb_skipempty(false)
00035 {}
00036
00037
00039
00040 CTBline::~CTBline()
00041 {}
00042
00043
00045
00046 void CTBline::Set(const char* c_line)
00047 {
00048 m_string = c_line;
00049 SetupString();
00050 return;
00051 }
00052
00053
00054 #ifdef DEV_DOCS
00055
00056 #endif
00057
00058 void CTBline::FromStream(istream& is)
00059 {
00060 for (;;) {
00061 bool b_ok = m_string.GetLine(is);
00062 SetupString();
00063 if (!b_ok || !mb_skipempty || m_string.Length() > 0) break;
00064 }
00065 return;
00066 }
00067
00068
00070
00071 void CTBline::SetupString()
00072 {
00073 if (mb_trimwhite) m_string.TrimWhite();
00074 if (mb_tolower) m_string.ToLowerCase();
00075 mb_streamvalid = false;
00076 return;
00077 }
00078
00079
00081
00082 void CTBline::SetupStream()
00083 {
00084 m_stream.~istrstream();
00085 new((void*)&m_stream) istrstream((const char*)m_string);
00086 mb_streamvalid = true;
00087 return;
00088 }
00089