diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-20 09:36:14 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-20 09:36:14 +0000 |
| commit | 694fb307aa7e582a55bce7e995bde3a4614b3b4f (patch) | |
| tree | 42bf3e703ebd706c9ebdd62bca59396f2d67a790 /src/StringFormat.cc | |
| parent | 580098eb4929a3bdbf424af18da361259ef2efe5 (diff) | |
2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced StringFormat with fmt
Diffstat (limited to 'src/StringFormat.cc')
| -rw-r--r-- | src/StringFormat.cc | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/StringFormat.cc b/src/StringFormat.cc deleted file mode 100644 index e5f5a943..00000000 --- a/src/StringFormat.cc +++ /dev/null @@ -1,68 +0,0 @@ -/* <!-- copyright */ -/* - * aria2 - The high speed download utility - * - * Copyright (C) 2006 Tatsuhiro Tsujikawa - * - * 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 - * - * In addition, as a special exception, the copyright holders give - * permission to link the code of portions of this program with the - * OpenSSL library under certain conditions as described in each - * individual source file, and distribute linked combinations - * including the two. - * You must obey the GNU General Public License in all respects - * for all of the code used other than OpenSSL. If you modify - * file(s) with this exception, you may extend this exception to your - * version of the file(s), but you are not obligated to do so. If you - * do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source - * files in the program, then also delete it here. - */ -/* copyright --> */ -#include "StringFormat.h" -#include <ostream> -#include <cstring> -#include <cstdio> -#include <cstdarg> -#include <cstdlib> - -namespace aria2 { - -StringFormat::StringFormat(const char* fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - char buf[1024]; - if(vsnprintf(buf, sizeof(buf), fmt, ap) > 0) { - msg_ = buf; - } - va_end(ap); -} - -StringFormat::~StringFormat() {} - -const std::string& StringFormat::str() const -{ - return msg_; -} - -std::ostream& operator<<(std::ostream& o, const StringFormat& fmt) -{ - o << fmt.str(); - return o; -} - -} // namespace aria2 |
