38 FileList::FileList() {
69 istm.open(listFile.toString().toLatin1().data(), std::ios::in);
85 QString msg =
"File [" + listFile.toString() +
"] contains no data";
101 void FileList::read(std::istream &in) {
105 bool bHasQuotes =
false;
107 in.getline(buf, 65536);
108 bool isComment =
false;
111 string::size_type loc = s.find(
"\"", 0);
113 if (loc != string::npos) {
125 if(strlen(buf) == 0) {
126 in.getline(buf, 65536);
129 for (
int index = 0; index < (int)strlen(buf); index++) {
130 if (buf[index] ==
'#' || (buf[index] ==
'/' && buf[index+1] ==
'/')) {
134 else if(buf[index] ==
' ') {
143 in.getline(buf, 65536);
149 s = s.
Token(
" \n\r\t\v");
152 s = s.
Token(
" \n\r\t\v,");
155 this->push_back(s.
ToQt());
156 in.getline(buf, 65536);
159 if (this->size() == 0) {
160 string msg =
"Input Stream Empty";
177 ostm.open(outputFileList.toString().toLatin1().data(), std::ios::out);
196 void FileList::write(std::ostream &out) {
197 for (
int i = 0; i < this->size(); i++) {
198 out << (*this)[i].toString() << endl;
QString ToQt() const
Retuns the object string as a QString.
File name manipulation and expansion.
IString TrimHead(const std::string &chars)
Trims The input characters from the beginning of the object IString.
IString Token(const IString &separator)
Returns the first token in the IString.
void read(FileName listFile)
Constructs a FileList from a stream.
#define _FILEINFO_
Macro for the filename and line number.
Adds specific functionality to C++ strings.
QString FileOpen(const QString &filename)
This error should be used when a file could not be opened.
IString TrimTail(const std::string &chars)
Trims the input characters from the end of the object IString.