本文整理汇总了C++中boost::string_ref::end方法的典型用法代码示例。如果您正苦于以下问题:C++ string_ref::end方法的具体用法?C++ string_ref::end怎么用?C++ string_ref::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::string_ref
的用法示例。
在下文中一共展示了string_ref::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_string
void print_string(boost::string_ref str, std::ostream& out)
{
for (boost::string_ref::const_iterator cur = str.begin();
cur != str.end(); ++cur)
{
print_char(*cur, out);
}
}
示例2: cpp_name
std::string codegen_base::cpp_name(boost::string_ref name)
{
std::string result;
if (!std::isalpha(name[0]))
result = "_";
std::transform(name.begin(), name.end(), std::back_inserter(result),
[] (char c) { return std::isalnum(c) ? c : '_'; });
return result;
}
示例3: is_emm_file
inline bool is_emm_file(boost::string_ref path)
{
std::ifstream ifs( convert_code( path, CP_UTF8, CP_OEMCP ), std::ios::binary );
if( ifs.fail() ) {
return false;
}
std::istreambuf_iterator< char > first( ifs ), last;
boost::string_ref const seg( "[Info]\r\nVersion = 3\r\n" );
return std::search( first, last, seg.begin(), seg.end() ) != last;
}
示例4: drive_letter_exists
inline bool drive_letter_exists(Iterator itr, Iterator end)
{
boost::string_ref const str( ":\\" );
if( std::distance( itr, end ) < static_cast< std::ptrdiff_t >( str.size() + 1 ) ) {
return false;
}
for( int i = 'A'; i <= 'Z'; ++i ) {
if( *itr == i ) {
return std::equal( str.begin(), str.end(), itr + 1 );
}
}
return false;
}
示例5: index
id_placeholder::id_placeholder(
unsigned index,
boost::string_ref id,
id_category category,
id_placeholder const* parent_)
: index(index),
unresolved_id(parent_ ?
parent_->unresolved_id + '.' + detail::to_s(id) :
detail::to_s(id)),
id(id.begin(), id.end()),
parent(parent_),
category(category),
num_dots(boost::range::count(id, '.') +
(parent_ ? parent_->num_dots + 1 : 0))
{
}
示例6: encode_string
std::string encode_string(boost::string_ref str)
{
std::string result;
result.reserve(str.size());
for (boost::string_ref::const_iterator it = str.begin();
it != str.end(); ++it)
{
switch (*it)
{
case '<': result += "<"; break;
case '>': result += ">"; break;
case '&': result += "&"; break;
case '"': result += """; break;
default: result += *it; break;
}
}
return result;
}
示例7: if
std::string
escaped_string(boost::string_ref const& s)
{
std::string out;
out.reserve(s.size());
char const* p = s.data();
while(p != s.end())
{
if(*p == '\r')
out.append("\\r");
else if(*p == '\n')
out.append("\\n");
else if(*p == '\t')
out.append("\\t");
else
out.append(p, 1);
++p;
}
return out;
}
示例8: generic_to_path
fs::path generic_to_path(boost::string_ref x)
{
return fs::path(x.begin(), x.end());
}
示例9: parse
url::
url(const boost::string_ref &ref)
: m_string { ref.begin(), ref.end() }
{
parse();
}
示例10: file
file(file const& f, boost::string_ref source) :
path(f.path), source_(source.begin(), source.end()),
is_code_snippets(f.is_code_snippets),
qbk_version(f.qbk_version), ref_count(0)
{}
示例11: operator
size_t operator()(const boost::string_ref& strRef) const
{
return boost::hash_range(strRef.begin(), strRef.end());
}
示例12: string
inline std::string to_s(boost::string_ref x) {
return std::string(x.begin(), x.end());
}
示例13: escape_uri
inline std::string escape_uri(boost::string_ref uri) {
return escape_uri(std::string(uri.begin(), uri.end()));
}
示例14: operator
auto operator()(boost::string_ref string) const
{
return boost::hash_range(string.begin(), string.end());
}
示例15: callout
void syntax_highlight_actions::callout(parse_iterator, parse_iterator)
{
out << state.add_callout(qbk_value(state.current_file,
marked_text.begin(), marked_text.end()));
marked_text.clear();
}