1 ///@file Wrapper class for Nasal strings
3 // Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Library General Public
7 // License as published by the Free Software Foundation; either
8 // version 2 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Library General Public License for more details.
15 // You should have received a copy of the GNU Library General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef SG_NASAL_STRING_HXX_
20 #define SG_NASAL_STRING_HXX_
22 #include "from_nasal.hxx"
23 #include "to_nasal.hxx"
35 static const size_t npos;
38 * Create a new Nasal String
40 * @param c Nasal context for creating the string
41 * @param str String data
43 String(naContext c, const char* str);
46 * Initialize from an existing Nasal String
48 * @param str Existing Nasal String
52 const char* c_str() const;
53 const char* begin() const;
54 const char* end() const;
57 size_t length() const;
60 int compare(size_t pos, size_t len, const String& rhs) const;
61 bool starts_with(const String& rhs) const;
62 bool ends_with(const String& rhs) const;
64 size_t find(const char c, size_t pos = 0) const;
65 size_t find_first_of(const String& chr, size_t pos = 0) const;
66 size_t find_first_not_of(const String& chr, size_t pos = 0) const;
69 * Get Nasal representation of String
71 const naRef get_naRef() const;
81 #endif /* SG_NASAL_STRING_HXX_ */