1 #ifndef _fieldsplit_hpp__included__
2 #define _fieldsplit_hpp__included__
8 * \brief Class for splitting string to fields.
10 * Splits string to fields on |
16 * \brief Create new string splitter
18 * Creates a new string splitter to split specified string.
19 * \param _line The line to split.
20 * \throws std::bad_alloc Out of memory.
22 fieldsplitter(const std::string
& _line
) throw(std::bad_alloc
);
24 * \brief More fields coming
26 * Checks if more fields are coming.
28 * \return True if more fields are coming, otherwise false.
30 operator bool() throw();
33 * \brief Read next field
35 * Reads the next field and returns it. If field doesn't exist, it reads as empty string.
37 * \return The read field.
38 * \throws std::bad_alloc
40 operator std::string() throw(std::bad_alloc
);
47 * \brief Class for splitting string to fields.
49 * Splits string to fields on ' ' and '\t', with multiple whitespace collapsed into one.
54 tokensplitter(const std::string
& _line
) throw(std::bad_alloc
);
55 operator bool() throw();
56 operator std::string() throw(std::bad_alloc
);
57 std::string
tail() throw(std::bad_alloc
);