| 1 | /* |
| 2 | * Copyright (C) 2000,2001 Onlyer ([email protected]) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (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 | */ |
| 18 | #ifndef INCLUDED_XSTRING_H |
| 19 | #define INCLUDED_XSTRING_Hcxx . . $ `src/common/xstring.h:19:9`! |
| 20 | |
| 21 | |
| 22 | #include <string> |
| 23 | #include <sstream> |
| 24 | #include <vector> |
| 25 | |
| 26 | namespace pvpgncxx . . $ pvpgn/ |
| 27 | { |
| 28 | |
| 29 | extern char * strtolowercxx . . $ pvpgn/strtolower(7a9722d75b371431).(char * str); |
| 30 | extern char * hexstrdupcxx . . $ pvpgn/hexstrdup(978de2d1319386df).(unsigned char const * src); |
| 31 | extern unsigned int hexstrtorawcxx . . $ pvpgn/hexstrtoraw(3560bc29fc3dba48).(unsigned char const * src, char * data, unsigned int datalen); |
| 32 | extern unsigned char xtoicxx . . $ pvpgn/xtoi(50106d451684defa).(unsigned char ch); |
| 33 | extern char * * strtoargvcxx . . $ pvpgn/strtoargv(40c3717ab9e55081).(char const * str, unsigned int * count); |
| 34 | extern char * arraytostrcxx . . $ pvpgn/arraytostr(2633cd5eeccb56c6).(char * * array, char const * delim, int count); |
| 35 | extern char * str_strip_affixcxx . . $ pvpgn/str_strip_affix(b7b3a83273496486).(char * str, char const * affix); |
| 36 | extern char *str_replacecxx . . $ pvpgn/str_replace(a1df38fec57fccd9).(char *orig, char *rep, char *with); |
| 37 | extern stdcxx . . $ std/::stringcxx . . $ std/string# str_replace_nlcxx . . $ pvpgn/str_replace_nl(d06bf7adff8c4caf).(char const * text); |
| 38 | extern bool find_substrcxx . . $ pvpgn/find_substr(9efbdc942cde3d3d).(char * input, const char * find); |
| 39 | |
| 40 | #define safe_touppercxx . . $ `src/common/xstring.h:40:10`!(X) (std::islower((unsigned char)X)?std::toupper((unsigned char)X):(X)) |
| 41 | #define safe_tolowercxx . . $ `src/common/xstring.h:41:10`!(X) (std::isupper((unsigned char)X)?std::tolower((unsigned char)X):(X)) |
| 42 | |
| 43 | /* |
| 44 | Fix for std::string for some unix compilers |
| 45 | http://stackoverflow.com/a/20861692/701779 |
| 46 | */ |
| 47 | template < typename T > stdcxx . . $ std/::stringcxx . . $ std/string# std_to_stringcxx . . $ pvpgn/std_to_string(23b83986b497e4d5).(const T& n) |
| 48 | { |
| 49 | stdcxx . . $ std/::ostringstreamcxx . . $ std/ostringstream# stmcxx . . $ std/__cxx11/basic_ostringstream#basic_ostringstream(49f6e7a06ebc5aa8).; |
| 50 | stm << n; |
| 51 | return stm.strcxx . . $ std/__cxx11/basic_ostringstream#str(d33e1a6fd36255f7).(); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | #endif |