summaryrefslogtreecommitdiff
path: root/decoder/stringlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/stringlib.h')
-rw-r--r--decoder/stringlib.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/decoder/stringlib.h b/decoder/stringlib.h
index 9efe3f36..b3097bd1 100644
--- a/decoder/stringlib.h
+++ b/decoder/stringlib.h
@@ -1,6 +1,10 @@
#ifndef CDEC_STRINGLIB_H_
#define CDEC_STRINGLIB_H_
+//usage: string s=MAKESTRE(1<<" "<<c);
+#define MAKESTR(expr) ((dynamic_cast<ostringstream &>(ostringstream()<<std::dec<<expr)).str())
+// std::dec (or seekp, or another manip) is needed to convert to std::ostream reference.
+
#ifdef STRINGLIB_DEBUG
#include <iostream>
#define SLIBDBG(x) do { std::cerr<<"DBG(stringlib): "<<x<<std::endl; } while(0)
@@ -13,6 +17,7 @@
#include <cctype>
#include <cstring>
#include <string>
+#include <sstream>
template <class Istr, class Isubstr> inline
bool match_begin(Istr bstr,Istr estr,Isubstr bsub,Isubstr esub)