8 #include "IException.h"
22 FileList::FileList() {
40 FileList::FileList(std::istream &in) {
55 istm.open(listFile.
toString().toLatin1().data(), std::ios::in);
58 throw IException(IException::Io, message, _FILEINFO_);
70 QString msg =
"File [" + listFile.
toString() +
"] contains no data";
71 throw IException(IException::User, msg, _FILEINFO_);
86 void FileList::read(std::istream &in) {
90 bool bHasQuotes =
false;
92 bool isComment =
false;
94 in.getline(buf, 65536);
97 string::size_type loc = s.find(
"\"", 0);
99 if (loc != string::npos) {
111 if(strlen(buf) == 0) {
114 for (
int index = 0; index < (int)strlen(buf); index++) {
115 if (buf[index] ==
'#' || (buf[index] ==
'/' && buf[index+1] ==
'/')) {
119 else if(buf[index] ==
' ') {
133 s = s.
Token(
" \n\r\t\v");
136 s = s.
Token(
" \n\r\t\v,");
139 this->push_back(s.
ToQt());
143 if (this->size() == 0) {
144 string msg =
"Input Stream Empty";
145 throw IException(IException::User, msg, _FILEINFO_);
161 ostm.open(outputFileList.
toString().toLatin1().data(), std::ios::out);
163 QString message = Message::FileOpen(outputFileList.
toString());
164 throw IException(IException::Io, message, _FILEINFO_);
180 void FileList::write(std::ostream &out) {
181 for (
int i = 0; i < this->size(); i++) {
182 out << (*this)[i].toString() << endl;