summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-10 18:44:08 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-10 18:44:08 -0500
commitac885a907525589aa56266d9a2527cdc7127c9cb (patch)
treed95c1cd20cb7df81b643f35c840c379fcae3f547 /src/utils.h
parent0ac2dc28104253faf82a3ed3d12bb16a1a150067 (diff)
downloadfork-ledger-ac885a907525589aa56266d9a2527cdc7127c9cb.tar.gz
fork-ledger-ac885a907525589aa56266d9a2527cdc7127c9cb.tar.bz2
fork-ledger-ac885a907525589aa56266d9a2527cdc7127c9cb.zip
All strings passed to Python are now Unicode objects
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/utils.h b/src/utils.h
index bfdee0b2..8ddc3c44 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -62,10 +62,6 @@
#define TIMERS_ON 1
#endif
-#if defined(VERIFY_ON)
-//#define STRING_VERIFY_ON 1
-#endif
-
/*@}*/
/**
@@ -76,11 +72,7 @@
namespace ledger {
using namespace boost;
-#if defined(STRING_VERIFY_ON)
class string;
-#else
- typedef std::string string;
-#endif
typedef std::list<string> strings_list;
@@ -162,12 +154,33 @@ void trace_dtor_func(void * ptr, const char * cls_name, std::size_t cls_size);
void report_memory(std::ostream& out, bool report_all = false);
-#if defined(STRING_VERIFY_ON)
+} // namespace ledger
+
+#else // ! VERIFY_ON
+
+#define VERIFY(x)
+#define DO_VERIFY() true
+#define TRACE_CTOR(cls, args)
+#define TRACE_DTOR(cls)
+
+#endif // VERIFY_ON
+
+#define IF_VERIFY() if (DO_VERIFY())
+
+/*@}*/
/**
- * This string type is a wrapper around std::string that allows us to
- * trace constructor and destructor calls.
+ * @name String wrapper
+ *
+ * This string type is a wrapper around std::string that allows us to trace
+ * constructor and destructor calls. It also makes ledger's use of strings a
+ * unique type, that the Boost.Python code can use as the basis for
+ * transparent Unicode conversions.
*/
+/*@{*/
+
+namespace ledger {
+
class string : public std::string
{
public:
@@ -240,24 +253,11 @@ inline bool operator!=(const char* __lhs, const string& __rhs)
inline bool operator!=(const string& __lhs, const char* __rhs)
{ return __lhs.compare(__rhs) != 0; }
-#endif // STRING_VERIFY_ON
+extern string empty_string;
-} // namespace ledger
-
-#else // ! VERIFY_ON
+strings_list split_arguments(const char * line);
-#define VERIFY(x)
-#define DO_VERIFY() true
-#define TRACE_CTOR(cls, args)
-#define TRACE_DTOR(cls)
-
-#endif // VERIFY_ON
-
-extern ledger::string empty_string;
-
-ledger::strings_list split_arguments(const char * line);
-
-#define IF_VERIFY() if (DO_VERIFY())
+} // namespace ledger
/*@}*/