string_conversion.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. XCC Utilities and Library
  3. Copyright (C) 2000 Olaf van der Spek <[email protected]>
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #pragma once
  16. #include <string>
  17. int a2ip(const std::string&);
  18. std::string ip2a(int);
  19. int get_net_mask(int);
  20. int get_net_part(int);
  21. bool atob(std::string);
  22. std::string btoa(bool);
  23. std::string js_encode(const std::string&);
  24. std::string n(long long);
  25. std::string swsl(int l, std::string);
  26. std::string swsr(int l, std::string);
  27. std::string nwp(int l, unsigned int);
  28. std::string nwsl(int l, unsigned int);
  29. std::string nwzl(int l, unsigned int);
  30. std::string nh(int l, long long v);
  31. void split_key(const std::string& key, std::string& name, std::string& value);
  32. std::string tabs2spaces(const std::string&);
  33. std::string time2a(time_t);
  34. std::string trim_field(const std::string&);
  35. std::string trim_text(const std::string&);