///////////////////////////////////////////////////////////////////////////// // Name: pokemod/String.h // Purpose: A custom string class derived from the C++ standard string // to accomodate simple format functionality // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Mon Feb 19 22:07:02 2007 // Copyright: ©2007 Nerdy Productions // Licence: // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ///////////////////////////////////////////////////////////////////////////// #ifndef __POKEMOD_STRING__ #define __POKEMOD_STRING__ #include #include #include #include namespace PokeGen { namespace PokeMod { class String : public std::string { public: String(const std::string &str); String(const char *fmt = "", ...); void printf(const char *fmt, ...); operator const char *() const; private: typedef union { const char *s; char c; double f; int i; unsigned u; long l; unsigned long ul; }Format; void printf(const char *fmt, va_list &args); }; } } #endif