/usr/include/librevenge-0.0/librevenge/RVNGString.h is in librevenge-dev 0.0.4-6ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* librevenge
* Version: MPL 2.0 / LGPLv2.1+
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Major Contributor(s):
* Copyright (C) 2004 William Lachance (wrlach@gmail.com)
* Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms
* of the GNU Lesser General Public License Version 2.1 or later
* (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
* applicable instead of those above.
*/
#ifndef RVNGSTRING_H
#define RVNGSTRING_H
#include "librevenge-api.h"
namespace librevenge
{
class RVNGStringImpl;
/** UTF-8 string.
*/
class REVENGE_API RVNGString
{
public:
RVNGString();
RVNGString(const RVNGString &other);
RVNGString(const char *str);
~RVNGString();
/** Create a new string from \a s as escaped XML.
*
* This function can be used instead of #appendEscapedXML(const RVNGString&) in contexts
* where only a temporary string is needed.
*
* @sa appendEscapedXML(const RVNGString&)
*/
static RVNGString escapeXML(const RVNGString &s);
/** Create a new string from \a s as escaped XML.
*
* This function can be used instead of #appendEscapedXML(const char*) in contexts
* where only a temporary string is needed.
*
* @sa appendEscapedXML(const char*)
*/
static RVNGString escapeXML(const char *s);
const char *cstr() const;
/** Return the number of UTF-8 characters.
*
* @sa size()
*/
int len() const;
/** Return the size in bytes of the data buffer.
*
* This is equivalent to <code>strlen(str.cstr())</code>
*
* @sa len()
*/
unsigned long size() const;
bool empty() const;
void sprintf(const char *format, ...) REVENGE_ATTRIBUTE_PRINTF(2, 3);
void append(const RVNGString &s);
void append(const char *s);
void append(const char c);
/** Append the content of @a s as escaped XML.
@sa escapeXML(const RVNGString&)
*/
void appendEscapedXML(const RVNGString &s);
/** Append the content of @a s as escaped XML.
@sa escapeXML(const char*)
*/
void appendEscapedXML(const char *s);
void clear();
RVNGString &operator=(const RVNGString &str);
RVNGString &operator=(const char *s);
// Comparison
bool operator==(const char *s) const;
bool operator==(const RVNGString &str) const;
inline bool operator!=(const char *s) const
{
return !operator==(s);
}
inline bool operator!=(const RVNGString &str) const
{
return !operator==(str);
}
bool operator<(const char *s) const;
bool operator<(const RVNGString &str) const;
inline bool operator<=(const char *s) const
{
return operator==(s) || operator<(s);
}
inline bool operator<=(const RVNGString &str) const
{
return operator==(str) || operator<(str);
}
inline bool operator>=(const char *s) const
{
return !operator<(s);
}
inline bool operator>=(const RVNGString &str) const
{
return !operator<(str);
}
inline bool operator>(const char *s) const
{
return !operator<=(s);
}
inline bool operator>(const RVNGString &str) const
{
return !operator<=(str);
}
class REVENGE_API Iter
{
public:
Iter(const RVNGString &str);
virtual ~Iter();
void rewind();
bool next();
bool last();
const char *operator()() const;
private:
Iter(const Iter &);
Iter &operator=(const Iter &);
RVNGStringImpl *m_stringImpl;
int m_pos;
mutable char *m_curChar;
};
private:
RVNGStringImpl *m_stringImpl;
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
|