5#ifndef BALL_FORMAT_LINEBASEDFILE_H
6#define BALL_FORMAT_LINEBASEDFILE_H
8#ifndef BALL_SYSTEM_FILE_H
135 void test(
const char* file,
int line,
bool condition,
const String& msg)
const;
187# ifndef BALL_NO_INLINE_FUNCTIONS
188# include <BALL/FORMAT/lineBasedFile.iC>
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
static const char * CHARACTER_CLASS__WHITESPACE
Position getLineNumber() const
Get the last line number in the file.
bool gotoLine(Position line_number)
String getField(Index pos=0, const String "es="", const String &delimiters=String::CHARACTER_CLASS__WHITESPACE) const
bool startsWith(const String &text) const
Test if the current line starts with text.
void enableTrimWhitespaces(bool state)
Set wheter leading and trailing whitespaces in lines shall be removed.
String line_
buffer for the line in use
LineBasedFile()
Default constructor.
bool parseColumnFormat(const char *format, Position index, Size length, void *arg)
LineBasedFile(const String &filename, File::OpenMode open_mode=std::ios::in, bool trim_whitespaces=false)
vector< char > col_buffer_
buffer for column parsing
bool trimWhiteSpacesEnabled() const
String & getLine()
Return the current line.
Index switchString(const std::vector< String > &data) const
void test(const char *file, int line, bool condition, const String &msg) const
bool skipLines(Size number=1)
bool search(const String &text, bool return_to_start=false)
bool search(const String &text, const String &stop, bool return_to_start=false)
Position line_number_
line number in the file
const String & getLine() const
Return the current line.
bool has(const String &text) const
Return true if the current line contains text.
std::ios::openmode OpenMode