C++11 library providing functionality common to all adapters.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.4 KiB

5 months ago
  1. // This file is under GNU General Public License 3.0
  2. // see LICENSE.txt
  3. #ifndef LIBPEPADAPTER_UTILS_HH
  4. #define LIBPEPADAPTER_UTILS_HH
  5. #include "pEpLog.hh"
  6. #include <pEp/message.h>
  7. #include <pEp/identity_list.h>
  8. #include <pEp/group.h>
  9. #include <exception>
  10. #include <vector>
  11. #include <string>
  12. namespace pEp {
  13. namespace Utils {
  14. // C-types to C++ types
  15. std::vector<::pEp_identity *> to_cxx(const ::identity_list &idl);
  16. // pEpEngine datatypes to string
  17. std::string to_string(const ::pEp_identity *const ident, bool full = true, int indent = 0);
  18. std::string to_string(const ::bloblist_t *const ident, bool full = true, int indent = 0);
  19. std::string to_string(const ::stringpair_list_t *const spl, bool full = true, int indent = 0);
  20. std::string to_string(const ::message *const msg, bool full = true, int indent = 0);
  21. std::string to_string(const ::identity_list *const idl, bool full = true, int indent = 0);
  22. std::string to_string(const ::pEp_member *const member, bool full = true, int indent = 0);
  23. std::string to_string(const ::member_list *const mbl, bool full = true, int indent = 0);
  24. std::string to_string(const ::pEp_group *const group, bool full = true, int indent = 0);
  25. // Misc
  26. std::string readKey(); // TODO: Move to std_utils
  27. } // namespace Utils
  28. } // namespace pEp
  29. #endif // LIBPEPADAPTER_UTILS_HH