本文整理汇总了C++中PositionT::get_file方法的典型用法代码示例。如果您正苦于以下问题:C++ PositionT::get_file方法的具体用法?C++ PositionT::get_file怎么用?C++ PositionT::get_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PositionT
的用法示例。
在下文中一共展示了PositionT::get_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filename
inline
lexer<IteratorT, PositionT>::lexer(IteratorT const &first,
IteratorT const &last, PositionT const &pos,
boost::wave::language_support language)
: filename(pos.get_file()), at_eof(false), language(language)
{
using namespace std; // some systems have memset in std
memset(&scanner, '\0', sizeof(Scanner));
scanner.fd = -1;
scanner.eol_offsets = aq_create();
scanner.first = scanner.act = (uchar *)&(*first);
scanner.last = scanner.first + std::distance(first, last);
scanner.line = pos.get_line();
scanner.column = scanner.curr_column = pos.get_column();
scanner.error_proc = report_error;
scanner.file_name = filename.c_str();
#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0
scanner.enable_ms_extensions = 1;
#else
scanner.enable_ms_extensions = 0;
#endif
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
scanner.act_in_c99_mode = boost::wave::need_c99(language);
#endif
}
示例2: result
inline typename ContainerT::value_type::string_type
as_stringlit (std::vector<ContainerT> const &arguments,
typename std::vector<ContainerT>::size_type i, PositionT const &pos)
{
using namespace boost::wave;
typedef typename ContainerT::value_type::string_type string_type;
BOOST_ASSERT(i < arguments.size());
string_type result("\"");
bool was_whitespace = false;
for (/**/; i < arguments.size(); ++i) {
// stringize all remaining arguments
typename ContainerT::const_iterator end = arguments[i].end();
for (typename ContainerT::const_iterator it = arguments[i].begin();
it != end; ++it)
{
token_id id = token_id(*it);
if (IS_CATEGORY(*it, WhiteSpaceTokenType) || T_NEWLINE == id) {
if (!was_whitespace) {
// C++ standard 16.3.2.2 [cpp.stringize]
// Each occurrence of white space between the argument's
// preprocessing tokens becomes a single space character in the
// character string literal.
result += " ";
was_whitespace = true;
}
}
else if (T_STRINGLIT == id || T_CHARLIT == id) {
// string literals and character literals have to be escaped
result += impl::escape_lit((*it).get_value());
was_whitespace = false;
}
else if (T_PLACEMARKER != id) {
// now append this token to the string
result += (*it).get_value();
was_whitespace = false;
}
}
// append comma, if not last argument
if (i < arguments.size()-1) {
result += ",";
was_whitespace = false;
}
}
result += "\"";
// validate the resulting literal to contain no invalid universal character
// value (throws if invalid chars found)
boost::wave::cpplexer::impl::validate_literal(result, pos.get_line(),
pos.get_column(), pos.get_file());
return result;
}