coan  6.0.1
A C/C++ Configuration Analyzer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
citable.h File Reference
#include "parse_buffer.h"
#include "integer.h"
#include "chew.h"
#include <string>

Go to the source code of this file.

Functions

std::string citable (integer const &n)
 Make a citable version of an integral object. Make a citable version of an integral object - i.e. suitable for quoting in a diagnostic. More...
 
std::string citable (chewer< std::string > &chew, size_t len=std::string::npos)
 Make a citable version of length-delimited text. More...
 
std::string citable (chewer< parse_buffer > &chew, size_t len=std::string::npos)
 
std::string citable (bool cxx, std::string const &seq, size_t start=0, size_t len=std::string::npos)
 Make a citable version of part of a character-sequence. More...
 
std::string citable (bool cxx, parse_buffer const &seq, size_t start=0, size_t len=std::string::npos)
 

Detailed Description

This file defines overloads of free function citable

Definition in file citable.h.

Function Documentation

std::string citable ( chewer< std::string > &  chew,
size_t  len = std::string::npos 
)

Make a citable version of length-delimited text.

Make a citable version of text - suitable for quoting in a diagnostic - by stripping out linefeeds and replacing tabs with spaces.

Parameters
chewOn entry, a chewer<CharSeq> positioned at the offset in its associated CharSeq from which to scan. On return chew is positioned at the first offset not consumed.
lenThe length of the CharSeq to be scanned. std::string::npos denotes all the remainder.
Returns
A citable version of the delimited text.
std::string citable ( bool  cxx,
std::string const &  seq,
size_t  start = 0,
size_t  len = std::string::npos 
)
inline

Make a citable version of part of a character-sequence.

Make a citable version of a part of a character-sequence - suitable for quoting in a diagnostic - by stripping out linefeeds and replacing tabs with spaces.

Template Parameters
CharSeqA character-sequence type
Parameters
cxxScanning c/c++ code?
seqThe character-sequence to scan.
startThe offset in seq from which to scan.
lenThe length to be scanned.std::string::npos denotes the remainder of the buffer.
Returns
A citable version of the delimited text.

Definition at line 82 of file citable.h.

std::string citable ( integer const &  n)

Make a citable version of an integral object. Make a citable version of an integral object - i.e. suitable for quoting in a diagnostic.

Parameters
nThe integer to be converted to a citable string.
Returns
A citable string representation of n.