WPXString.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwpd
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Major Contributor(s):
10  * Copyright (C) 2004 William Lachance (wrlach@gmail.com)
11  * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
12  *
13  * For minor contributions see the git repository.
14  *
15  * Alternatively, the contents of this file may be used under the terms
16  * of the GNU Lesser General Public License Version 2.1 or later
17  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18  * applicable instead of those above.
19  *
20  * For further information visit http://libwpd.sourceforge.net
21  */
22 
23 /* "This product is not manufactured, approved, or supported by
24  * Corel Corporation or Corel Corporation Limited."
25  */
26 
27 #ifndef WPXSTRING_H
28 #define WPXSTRING_H
29 
30 class WPXStringImpl;
31 
32 class WPXString
33 {
34 public:
35  WPXString();
36  WPXString(const WPXString &, bool escapeXML = false);
37  WPXString(const char *str);
38  ~WPXString();
39 
40  const char *cstr() const;
41  int len() const;
42 
43  void sprintf(const char *format, ...);
44  void append(const WPXString &s);
45  void append(const char *s);
46  void append(const char c);
47  void clear();
48  WPXString &operator=(const WPXString &str);
49  WPXString &operator=(const char *s);
50  bool operator==(const char *s) const;
51  bool operator==(const WPXString &str) const;
52  bool operator!() const;
53  inline bool operator!=(const char *s) const
54  {
55  return !operator==(s);
56  }
57  inline bool operator!=(const WPXString &str) const
58  {
59  return !operator==(str);
60  }
61 
62  class Iter
63  {
64  public:
65  Iter(const WPXString &str);
66  virtual ~Iter();
67  void rewind();
68  bool next();
69  bool last();
70  const char *operator()() const;
71  private:
72  Iter(const Iter &);
73  Iter &operator=(const Iter &);
75  int m_pos;
76  mutable char *m_curChar;
77  };
78 
79 private:
81 };
82 #endif
83 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
int len() const
Definition: WPXString.cpp:188
Definition: WPXString.h:32
Iter & operator=(const Iter &)
bool last()
Definition: WPXString.cpp:256
bool operator!=(const char *s) const
Definition: WPXString.h:53
WPXStringImpl * m_stringImpl
Definition: WPXString.h:80
const char * cstr() const
Definition: WPXString.cpp:131
bool next()
Definition: WPXString.cpp:239
Iter(const WPXString &str)
Definition: WPXString.cpp:220
Definition: WPXString.cpp:61
void sprintf(const char *format,...)
Definition: WPXString.cpp:136
void append(const WPXString &s)
Definition: WPXString.cpp:168
int m_pos
Definition: WPXString.h:75
virtual ~Iter()
Definition: WPXString.cpp:228
Definition: WPXString.h:62
const char * operator()() const
Definition: WPXString.cpp:263
char * m_curChar
Definition: WPXString.h:76
WPXString()
Definition: WPXString.cpp:73
WPXStringImpl * m_stringImpl
Definition: WPXString.h:74
bool operator!() const
Definition: WPXString.cpp:215
WPXString & operator=(const WPXString &str)
Definition: WPXString.cpp:193
bool operator!=(const WPXString &str) const
Definition: WPXString.h:57
void rewind()
Definition: WPXString.cpp:234
~WPXString()
Definition: WPXString.cpp:68
void clear()
Definition: WPXString.cpp:183
bool operator==(const char *s) const
Definition: WPXString.cpp:205

Generated for libwpd by doxygen 1.8.5