to_text.h.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <chapter xml:id="to_text.h">
  2. <title><tt>__vic/to_text.h</tt></title>
  3. <p>Converters of types to text representation.</p>
  4. <chapter xml:id="to_text_append">
  5. <title><tt>to_text_append()</tt></title>
  6. <code-block lang="C++"><![CDATA[
  7. void to_text_append(long long n, std::string &str);
  8. void to_text_append(long n, std::string &str);
  9. void to_text_append(int n, std::string &str);
  10. void to_text_append(short n, std::string &str);
  11. void to_text_append(signed char n, std::string &str);
  12. void to_text_append(unsigned long long n, std::string &str);
  13. void to_text_append(unsigned long n, std::string &str);
  14. void to_text_append(unsigned n, std::string &str);
  15. void to_text_append(unsigned short n, std::string &str);
  16. void to_text_append(unsigned char n, std::string &str);
  17. void to_text_append(long double n, std::string &str);
  18. void to_text_append(double n, std::string &str);
  19. void to_text_append(float n, std::string &str);
  20. void to_text_append(bool f, std::string &str);
  21. void to_text_append(const void *p, std::string &str);
  22. ]]></code-block>
  23. <p>Converters of non-character C++ fundamental types to some text
  24. representation. Second parameter <tt>str</tt> is an output parameter, result
  25. is appended to it.</p>
  26. <note><tt>signed char</tt> and <tt>unsigned char</tt> types are treated as
  27. integers not characters!</note>
  28. <synopsis>
  29. <prototype>void to_text_append(long long n, std::string &amp;str)</prototype>
  30. <prototype>void to_text_append(long n, std::string &amp;str)</prototype>
  31. <prototype>void to_text_append(int n, std::string &amp;str)</prototype>
  32. <prototype>void to_text_append(short n, std::string &amp;str)</prototype>
  33. <prototype>void to_text_append(signed char n, std::string &amp;str)</prototype>
  34. <prototype>void to_text_append(unsigned long long n, std::string &amp;str)</prototype>
  35. <prototype>void to_text_append(unsigned long n, std::string &amp;str)</prototype>
  36. <prototype>void to_text_append(unsigned n, std::string &amp;str)</prototype>
  37. <prototype>void to_text_append(unsigned short n, std::string &amp;str)</prototype>
  38. <prototype>void to_text_append(unsigned char n, std::string &amp;str)</prototype>
  39. <prototype>void to_text_append(long double n, std::string &amp;str)</prototype>
  40. <prototype>void to_text_append(double n, std::string &amp;str)</prototype>
  41. <prototype>void to_text_append(float n, std::string &amp;str)</prototype>
  42. <p>Converts a number to decimal representation.</p>
  43. </synopsis>
  44. <synopsis>
  45. <prototype>void to_text_append(bool f, std::string &amp;str)</prototype>
  46. <p>Converts a boolean value to <tt>0</tt> or <tt>1</tt>.</p>
  47. </synopsis>
  48. <synopsis>
  49. <prototype>void to_text_append(const void *p, std::string &amp;str)</prototype>
  50. <p>Converts a pointer to some platform-specific representation.</p>
  51. </synopsis>
  52. <section><title>Example</title>
  53. <code-block lang="C++">
  54. int n = 5;
  55. std::string st = "n = ";
  56. __vic::to_text_append(n, st);
  57. assert(st == "n = 5");
  58. </code-block>
  59. </section>
  60. </chapter>
  61. </chapter>