From 0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 19 Apr 2007 20:31:46 +0000 Subject: Made the amount/balance/value interface a bit more rational; added back a useless version of the register command (just to prove the command sequence); and added smart XML semantics to the XPath implementation so that nodes can be coerced to values. --- util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index 842879e5..dc14547a 100644 --- a/util.h +++ b/util.h @@ -96,4 +96,13 @@ std::string abbreviate(const std::string& str, unsigned int width, elision_style_t elision_style = TRUNCATE_TRAILING, const bool is_account = false, int abbrev_length = 2); +static inline const +std::string& either_or(const std::string& first, const std::string& second) +{ + if (first.empty()) + return second; + else + return first; +} + #endif // _UTIL_H -- cgit v1.2.3