cprintf.hh (4039:b910b61a52b9) | cprintf.hh (4213:37a61d11f39f) |
---|---|
1/* 2 * Copyright (c) 2002-2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 129 unchanged lines hidden (view full) --- 138 const CPrintfArgsList &args) 139{ 140 ccprintf(stream, format.c_str(), args); 141} 142 143inline void 144ccprintf(std::ostream &stream, const std::string &format, CPRINTF_DECLARATION) 145{ | 1/* 2 * Copyright (c) 2002-2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 129 unchanged lines hidden (view full) --- 138 const CPrintfArgsList &args) 139{ 140 ccprintf(stream, format.c_str(), args); 141} 142 143inline void 144ccprintf(std::ostream &stream, const std::string &format, CPRINTF_DECLARATION) 145{ |
146 ccprintf(stream, format, VARARGS_ALLARGS); | 146 ccprintf(stream, format.c_str(), VARARGS_ALLARGS); |
147} 148 149inline void 150cprintf(const std::string &format, CPRINTF_DECLARATION) 151{ | 147} 148 149inline void 150cprintf(const std::string &format, CPRINTF_DECLARATION) 151{ |
152 ccprintf(std::cout, format, VARARGS_ALLARGS); | 152 ccprintf(std::cout, format.c_str(), VARARGS_ALLARGS); |
153} 154 155inline std::string 156csprintf(const std::string &format, CPRINTF_DECLARATION) 157{ 158 std::stringstream stream; | 153} 154 155inline std::string 156csprintf(const std::string &format, CPRINTF_DECLARATION) 157{ 158 std::stringstream stream; |
159 ccprintf(stream, format, VARARGS_ALLARGS); | 159 ccprintf(stream, format.c_str(), VARARGS_ALLARGS); |
160 return stream.str(); 161} 162 163#endif // __CPRINTF_HH__ | 160 return stream.str(); 161} 162 163#endif // __CPRINTF_HH__ |