ucommon
string.h
Go to the documentation of this file.
1 // Copyright (C) 1999-2005 Open Source Telecom Corporation.
2 // Copyright (C) 2006-2010 David Sugar, Tycho Softworks.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
23 #ifndef COMMONCPP_STRING_H_
24 #define COMMONCPP_STRING_H_
25 
26 #ifndef COMMONCPP_CONFIG_H_
27 #include <commoncpp/config.h>
28 #endif
29 
30 NAMESPACE_COMMONCPP
31 
32 typedef ucommon::String String;
33 
34 __EXPORT char *lsetField(char *target, size_t size, const char *src, const char fill = 0);
35 __EXPORT char *rsetField(char *target, size_t size, const char *src, const char fill = 0);
36 __EXPORT char *newString(const char *src, size_t size = 0);
37 __EXPORT void delString(char *str);
38 __EXPORT char *setUpper(char *string, size_t size);
39 __EXPORT char *setLower(char *string, size_t size);
40 
41 inline char *setString(char *target, size_t size, const char *str)
42  {return String::set(target, size, str);}
43 
44 inline char *addString(char *target, size_t size, const char *str)
45  {return String::add(target, size, str);}
46 
47 inline char *dupString(const char *src, size_t size = 0)
48  {return newString(src, size);}
49 
50 /*
51 __EXPORT char *find(const char *cs, char *str, size_t len = 0);
52 __EXPORT char *rfind(const char *cs, char *str, size_t len = 0);
53 __EXPORT char *ifind(const char *cs, char *str, size_t len = 0);
54 __EXPORT char *strip(const char *cs, char *str, size_t len = 0);
55 __EXPORT size_t strchop(const char *cs, char *str, size_t len = 0);
56 __EXPORT size_t strtrim(const char *cs, char *str, size_t len = 0);
57 
58 */
59 
60 END_NAMESPACE
61 
62 #endif
A copy-on-write string class that operates by reference count.
Definition: string.h:82