00001 #ifndef LIBSHERPA_FORMAT_H 00002 #define LIBSHERPA_FORMAT_H 00003 00004 /************************************************************************** 00005 * 00006 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, The EROS 00007 * Group, LLC. 00008 * Copyright (C) 2004, 2005, 2006, Johns Hopkins University. 00009 * All rights reserved. 00010 * 00011 * Redistribution and use in source and binary forms, with or 00012 * without modification, are permitted provided that the following 00013 * conditions are met: 00014 * 00015 * - Redistributions of source code must contain the above 00016 * copyright notice, this list of conditions, and the following 00017 * disclaimer. 00018 * 00019 * - Redistributions in binary form must reproduce the above 00020 * copyright notice, this list of conditions, and the following 00021 * disclaimer in the documentation and/or other materials 00022 * provided with the distribution. 00023 * 00024 * - Neither the names of the copyright holders nor the names of any 00025 * of any contributors may be used to endorse or promote products 00026 * derived from this software without specific prior written 00027 * permission. 00028 * 00029 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00030 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00031 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00032 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00033 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00034 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00035 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00036 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00037 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00038 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00039 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00040 * 00041 **************************************************************************/ 00042 00043 #include <stdarg.h> 00044 00045 namespace sherpa { 00046 /* Format the printf-style arguments into a dynamically allocated 00047 string. This is intended for use with the exceptions package to 00048 format the explanation string. 00049 00050 It does not currently know how to format floating point values. */ 00051 std::string vformat(const char *fmt, va_list ap); 00052 00053 /* Format the printf-style arguments into a dynamically allocated 00054 string. This is intended for use with the exceptions package to 00055 format the explanation string. 00056 00057 It does not currently know how to format floating point values. */ 00058 std::string format(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 00059 } /* namespace sherpa */ 00060 00061 // Local Variables: 00062 // mode:c++ 00063 // End: 00064 00065 #endif /* LIBSHERPA_FORMAT_H */
1.4.7