IntroductionThe file position template is used to represent a concrete token position inside the underlying input stream. This token position contains the corresponding filename, the line number and the column number, where the token was recognized. Header wave/util/file_position.hpp synopsisnamespace boost { namespace wave { namespace util { template <typename String = std::string> class file_position { public: file_position(); explicit file_position(String const &file, int line_ = 1, int column_ = 1); // accessors String const &get_file() const; int get_line() const; int get_column() const; void set_file(String const &file); void set_line(int line); void set_column(int column); }; } // namespace util } // namespace wave } // namespace boost Template parametersThe file_position template used by the default token type has to be instantiated with one template parameter, which gives the string type to use for storing the file name member of the file position. If this parameter isn't given, it defaults to a std::string. Please note, that the type given as the template parameter must be compatible with a std::string. Please note, that the type given as the template parameter must be compatible with a std::string. You may use your own position types if appropriate, but in any case these should implement the same interface as the file_position template described here. Member functionsConstructorsfile_position(); explicit file_position(String const &file, int line_ = 1, int column_ = 1);
get_file, get_line, get_column String const &get_file() const; int get_line() const; int get_column() const;
set_file, set_line, set_column void set_file(String const &file); void set_line(int line); void set_column(int column);
Copyright © 2003-2008 Hartmut Kaiser Last updated: Sunday, October 12, 2008 20:14 |