remove some output formatting stuff that we don't use
--HG-- extra : convert_revision : 367917499d3d7aebd0a91dad28c915bc85def624
This commit is contained in:
parent
91ffe811a3
commit
e68a87e7fa
|
@ -165,36 +165,6 @@ __csprintf(const std::string &format, ArgList &args)
|
|||
#define csprintf(args...) \
|
||||
__csprintf__(args, cp::ArgListNull())
|
||||
|
||||
template<class T>
|
||||
inline ArgList &
|
||||
operator<<(ArgList &list, const T &data)
|
||||
{
|
||||
list.append(data);
|
||||
return list;
|
||||
}
|
||||
|
||||
inline ArgList &
|
||||
operator<<(std::ostream &str, ArgList &list)
|
||||
{
|
||||
list.stream = &str;
|
||||
return list;
|
||||
}
|
||||
|
||||
class ArgListTemp
|
||||
{
|
||||
private:
|
||||
std::string format;
|
||||
ArgList *args;
|
||||
|
||||
public:
|
||||
ArgListTemp(const std::string &f) : format(f) { args = new ArgList; }
|
||||
~ArgListTemp() { args->dump(format); delete args; }
|
||||
|
||||
operator ArgList *() { return args; }
|
||||
};
|
||||
|
||||
#define cformat(format) \
|
||||
(*((cp::ArgList *)cp::ArgListTemp(format)))
|
||||
}
|
||||
|
||||
#endif // __CPRINTF_HH__
|
||||
|
|
|
@ -48,9 +48,6 @@ main()
|
|||
cprintf("%%s%-10s %c he went home \'\"%d %#o %#x %1.5f %1.2E\n",
|
||||
"hello", 'A', 1, 0xff, 0xfffffffffffffULL, 3.141592653589, 1.1e10);
|
||||
|
||||
cout << cformat("%s %#x %s\n") << "hello" << 0 << "foo 0\n";
|
||||
cerr << cformat("%s %#x\n") << "hello" << 1 << "foo 1\n";
|
||||
|
||||
cprintf("another test\n");
|
||||
|
||||
stringstream buffer;
|
||||
|
|
Loading…
Reference in a new issue