3rdParty/boost/1.78.0/libs/wave/doc/class_reference_filepos.html
|
Introduction
Header 'wave/util/file_position.hpp' synopsis
Template parameters
Member functions
The 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.
namespaceboost{namespacewave{namespaceutil{template<typenameString =std::string>classfile_position {public:[file\_position](class_reference_filepos.html#constructors)();explicit[file\_position](class_reference_filepos.html#constructors)(String const &file,unsigned intline_ = 1,unsigned int column_ = 1);
// accessors
Stringconst&[get\_file](class_reference_filepos.html#get_accessors)()const;unsigned int[get\_line](class_reference_filepos.html#get_accessors)()const;unsigned int[get\_column](class_reference_filepos.html#get_accessors)()const;void[set\_file](class_reference_filepos.html#set_accessors)(Stringconst&file);void[set\_line](class_reference_filepos.html#set_accessors)(intline);void[set\_column](class_reference_filepos.html#set_accessors)(intcolumn);
};
}// namespace util}// namespace wave}// namespace boost
The 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.
[file\_position](class_reference_filepos.html#constructors)();explicit[file\_position](class_reference_filepos.html#constructors)(String const &file,unsigned int line_ = 1,unsigned int column_ = 1);
The constructors initialize a new instance of a file_position in correspondence to the supplied parameters. The parameters default to an empty filename and the line number and column number set to one.
get_file , get_line , get_column
Stringconst&[get\_file](class_reference_filepos.html#get_accessors)()const;unsigned int[get\_line](class_reference_filepos.html#get_accessors)()const;unsigned int[get\_column](class_reference_filepos.html#get_accessors)()const;
The get_... functions are used to access the current values of the file position members: the filename (get_file), the line number (get_line) and the column number (get_column).
set_file , set_line , set_column
void[set\_file](class_reference_filepos.html#set_accessors)(Stringconst&file);void[set\_line](class_reference_filepos.html#set_accessors)(unsigned intline);void[set\_column](class_reference_filepos.html#set_accessors)(unsigned intcolumn);
The set_... functions are used to set new values to the file position members: the filename (set_file), the line number (set_line) and the column number (set_column).
Copyright © 2003-2011 Hartmut Kaiser
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE\_1\_0.txt)
Last updated: Saturday, September 18, 2010 15:14