PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
file_strlist.h
Go to the documentation of this file.
1 /*
2  * Platformer Game Engine by Wohlstand, a free platform for game making
3  * Copyright (c) 2014-2015 Vitaly Novichkov <admin@wohlnet.ru>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
26 #ifndef FILE_STRLIST_H
27 #define FILE_STRLIST_H
28 
29 #ifdef PGE_FILES_QT
30 #include <QString>
31 #include <QStringList>
32 #include <QObject>
33 #define PGESTRING QString
34 #define PGESTRINGList QStringList
35 #else
36 #include <vector>
37 #include <string>
38 #define PGESTRING std::string
39 #define PGESTRINGList std::vector<std::string >
40 #endif
41 
45 #ifdef PGE_FILES_QT
46 class FileStringList:public QObject
47 {
48  Q_OBJECT
49 #else
51 {
52 #endif
53 
54 public:
59 
64  FileStringList(PGESTRING fileData);
65 
70 
75  void addData(PGESTRING fileData);
76 
82 
87  bool isEOF();
88 
93  bool atEnd();
94 private:
98  PGESTRINGList buffer;
99 
103  long lineID;
104 };
105 
106 #endif // FILE_STRLIST_H
107 
Provides string container automatically splited from entire file data.
Definition: file_strlist.h:50
bool isEOF()
Are all lines was gotten?
Definition: file_strlist.cpp:60
#define PGESTRING
A macro which equal to std::string if PGE File Library built in the STL mode and equal to QString if ...
Definition: pge_file_lib_globs.h:97
FileStringList()
Constructor.
Definition: file_strlist.cpp:22
~FileStringList()
Definition: file_strlist.cpp:32
bool atEnd()
Are all lines was gotten?
Definition: file_strlist.cpp:65
void addData(PGESTRING fileData)
Changes filedata and rebuilds list of lines.
Definition: file_strlist.cpp:37
PGESTRING readLine()
Returns current line contents and incements internal line counter.
Definition: file_strlist.cpp:48
#define PGESTRINGList
A macro which equal to std::vector if PGE File Library built in the STL mode and equal t...
Definition: pge_file_lib_globs.h:104