• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ut_std_string.h

Go to the documentation of this file.
00001 /* AbiSource Program Utilities
00002  * Copyright (C) 1998,1999 AbiSource, Inc.
00003  * Copyright (C) 2009-2015 Hubert Figuiere
00004  * Copyright (C) 2011 Ben Martin
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 
00022 
00023 #ifndef __UT_STD_STRING_H__
00024 #define __UT_STD_STRING_H__
00025 
00026 #include <string>
00027 #include <vector>
00028 #include <algorithm>
00029 #include <functional>
00030 #include <locale>
00031 
00032 #include "ut_types.h"
00033 
00034 
00038 ABI_EXPORT std::string UT_escapeXML(const std::string &);
00039 
00042 ABI_EXPORT std::string UT_decodeXML(const std::string &);
00043 
00044 ABI_EXPORT std::string& UT_std_string_vprintf (std::string & inStr,
00045                                                const char *format,
00046                                                va_list      args1)
00047     ABI_PRINTF_FORMAT(2,0);
00048 
00049 ABI_EXPORT std::string UT_std_string_sprintf(const char * inFormat, ...)
00050     ABI_PRINTF_FORMAT(1,2);
00051 
00052 
00059 ABI_EXPORT std::string UT_std_string_unicode(const UT_UCS4Char * unicode,
00060                                              UT_uint32 len);
00067 ABI_EXPORT std::string UT_std_stringFromEncoding(const char* bytes,
00068                                                  const char* encoding);
00069 
00073 ABI_EXPORT bool starts_with( const std::string& fullstring, const std::string& prefix );
00074 ABI_EXPORT bool ends_with(   const std::string& fullstring, const std::string& ending );
00075 ABI_EXPORT std::string replace_all( const std::string& s, char oldc, char newc );
00076 ABI_EXPORT std::string replace_all( const std::string& s,
00077                                     const std::string& olds,
00078                                     const std::string& news );
00079 
00084 ABI_EXPORT std::string & UT_tolower(std::string& s);
00085 
00086 ABI_EXPORT std::string UT_XML_cloneNoAmpersands( const std::string& szSource );
00087 
00088 ABI_EXPORT std::vector<std::string> UT_simpleSplit(const std::string & str,
00089                                                    char separator = ' ');
00090 
00091 
00095 ABI_EXPORT std::string UT_ellipsisPath(const std::string & path, size_t maxlen, size_t cut);
00096 
00100 ABI_EXPORT std::string UT_std_string_getPropVal(const std::string & sPropertyString, const std::string & sProp);
00101 ABI_EXPORT void UT_std_string_removeProperty(std::string & sPropertyString, const std::string & sProp);
00102 ABI_EXPORT void UT_std_string_setProperty(std::string & sPropertyString, const std::string &sProp, const std::string & sVal);
00103 
00104 ABI_EXPORT void UT_std_string_addPropertyString(std::string & sPropertyString, const std::string &sNewProp);
00105 
00106 
00107 ABI_EXPORT const std::string StreamToString( std::istream& iss );
00108 ABI_EXPORT std::string toTimeString( time_t TT );
00109 ABI_EXPORT time_t toTime( struct tm *tm );
00110 ABI_EXPORT time_t parseTimeString( const std::string& stddatestr );
00111 
00112 
00113 
00114 
00115 #endif
00116 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1