// This file is under GNU General Public License 3.0 // see LICENSE.txt #ifndef LIBPEPADAPTER_UTILS_HH #define LIBPEPADAPTER_UTILS_HH #include #include #include #include #include namespace pEp { namespace Test { namespace Log { void log(const std::string &msg); void logH1(const std::string &msg); void logH2(const std::string &msg); void lograw(const std::string &msg); } // namespace Log namespace Utils { // pEpEngine datatypes to string std::string to_string(const ::pEp_identity *const ident, bool full = true, int indent = 0); std::string to_string(const ::identity_list *const idl, bool full = true, int indent = 0); std::string to_string(const ::pEp_member *const member, bool full = true, int indent = 0); std::string to_string(const ::member_list *const mbl, bool full = true, int indent = 0); std::string to_string(const ::pEp_group *const group, bool full = true, int indent = 0); // C++/STL data types to string template std::string to_string(const std::vector &v); // exception utils std::string nested_exception_to_string( const std::exception &e, int level = 0, std::string src = ""); void print_exception(const std::exception &e, int level = 0); // file utils std::ofstream file_create(const std::string &filename); bool file_exists(const std::string &filename); void file_delete(const std::string &filename); void file_ensure_not_existing(const std::string &path); } // namespace Utils } // namespace Test } // namespace pEp #include "utils.hxx" #endif // LIBPEPADAPTER_UTILS_HH