ucommon
commoncpp/string.h
Go to the documentation of this file.
00001 // Copyright (C) 1999-2005 Open Source Telecom Corporation.
00002 // Copyright (C) 2006-2010 David Sugar, Tycho Softworks.
00003 //
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 
00023 #ifndef COMMONCPP_STRING_H_
00024 #define COMMONCPP_STRING_H_
00025 
00026 #ifndef COMMONCPP_CONFIG_H_
00027 #include <commoncpp/config.h>
00028 #endif
00029 
00030 NAMESPACE_COMMONCPP
00031 
00032 typedef ucommon::String String;
00033 
00034 __EXPORT char *lsetField(char *target, size_t size, const char *src, const char fill = 0);
00035 __EXPORT char *rsetField(char *target, size_t size, const char *src, const char fill = 0);
00036 __EXPORT char *newString(const char *src, size_t size = 0);
00037 __EXPORT void delString(char *str);
00038 __EXPORT char *setUpper(char *string, size_t size);
00039 __EXPORT char *setLower(char *string, size_t size);
00040 
00041 inline char *setString(char *target, size_t size, const char *str)
00042     {return String::set(target, size, str);}
00043 
00044 inline char *addString(char *target, size_t size, const char *str)
00045     {return String::add(target, size, str);}
00046 
00047 inline char *dupString(const char *src, size_t size = 0)
00048     {return newString(src, size);}
00049 
00050 /*
00051 __EXPORT char *find(const char *cs, char *str, size_t len = 0);
00052 __EXPORT char *rfind(const char *cs, char *str, size_t len = 0);
00053 __EXPORT char *ifind(const char *cs, char *str, size_t len = 0);
00054 __EXPORT char *strip(const char *cs, char *str, size_t len = 0);
00055 __EXPORT size_t strchop(const char *cs, char *str, size_t len = 0);
00056 __EXPORT size_t strtrim(const char *cs, char *str, size_t len = 0);
00057 
00058 */
00059 
00060 END_NAMESPACE
00061 
00062 #endif