coan  6.0.1
A C/C++ Configuration Analyzer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
citable.h
Go to the documentation of this file.
1 #ifndef CITABLE_H
2 #define CITABLE_H
3 #pragma once
4 /***************************************************************************
5  * Copyright (C) 2007-2013 Mike Kinghan, imk@burroingroingjoing.com *
6  * All rights reserved. *
7  * *
8  * Contributed originally by Mike Kinghan, imk@burroingroingjoing.com *
9  * *
10  * Redistribution and use in source and binary forms, with or without *
11  * modification, are permitted provided that the following conditions *
12  * are met: *
13  * *
14  * Redistributions of source code must retain the above copyright *
15  * notice, this list of conditions and the following disclaimer. *
16  * *
17  * Redistributions in binary form must reproduce the above copyright *
18  * notice, this list of conditions and the following disclaimer in the *
19  * documentation and/or other materials provided with the distribution. *
20  * *
21  * Neither the name of Mike Kinghan nor the names of its contributors *
22  * may be used to endorse or promote products derived from this software *
23  * without specific prior written permission. *
24  * *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
28  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
29  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
30  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
31  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
32  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED *
33  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,*
34  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
35  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
36  * DAMAGE. *
37  * *
38  **************************************************************************/
39 
40 #include "parse_buffer.h"
41 #include "integer.h"
42 #include "chew.h"
43 #include <string>
44 
49 
63 std::string citable(chewer<std::string> & chew, size_t len = std::string::npos);
64 std::string citable(chewer<parse_buffer> & chew, size_t len = std::string::npos);
66 
67 
69 
82 inline std::string citable(
83  bool cxx,
84  std::string const & seq,
85  size_t start = 0,
86  size_t len = std::string::npos)
87 {
88  chewer<std::string> chew(cxx,const_cast<std::string &>(seq),start);
89  return citable(chew,len);
90 }
91 
92 inline std::string citable(
93  bool cxx,
94  parse_buffer const & seq,
95  size_t start = 0,
96  size_t len = std::string::npos)
97 {
98  chewer<parse_buffer> chew(cxx,const_cast<parse_buffer &>(seq),start);
99  return citable(chew,len);
100 }
102 
109 std::string citable(integer const & n);
110 
111 
112 #endif //EOF
Class integer encapsulates an integer of some type.
Definition: integer.h:65
std::string citable(chewer< std::string > &chew, size_t len=std::string::npos)
Make a citable version of length-delimited text.
struct parse_buffer is a polymorphic base for classes representing possibly extensible lines of parse...
Definition: parse_buffer.h:51
`template struct chewer<CharSeq> is a cursor-like type that is associated with a character-sequence t...
Definition: chew.h:248