BusBoy  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Helpers.h
Go to the documentation of this file.
1 
17 #ifndef __BUSBOY_HELPERS_H__
18 #define __BUSBOY_HELPERS_H__
19 
20 #include <sstream>
21 #include "StackUtil.h"
22 
26 #define BUSBOY_FORMAT_STRING(targetString,message) { std::ostringstream _ss; _ss << message; targetString = _ss.str(); }
27 
31 #define BUSBOY_RETURN_STRING(message) { std::ostringstream _ss; _ss << message; return _ss.str(); }
32 
38 #define BUSBOY_THROW(name, message) { \
39  std::ostringstream _ss; \
40  _ss << message << std::endl << \
41  StackUtil::formatLocation(__FILE__, __FUNCTION__, __LINE__) << std::endl \
42  << StackUtil::generateBackTrace(); \
43  throw name(_ss.str()); \
44 }
45 
46 #define BUSBOY_DEBUG(message) { \
47  std::cout << message << " at " << \
48  StackUtil::formatLocation(__FILE__, __FUNCTION__, __LINE__) << std::endl; \
49 }
50 
51 #endif

Copyright 2014 Google Inc. All rights reserved.