0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00
Commit Graph

11 Commits

Author SHA1 Message Date
James Yonan
b2769db93a In format.hpp, work around a Windows symbol conflict
by renaming template var OUT to OUTPUT.
2015-10-08 21:52:59 -06:00
James Yonan
2df4f44711 Added/changed printfmt() format specifiers:
* %r formats any argument regardless of type
     and single-quotes it.
* %R formats any argument regardless of type
     and double-quotes it.
2015-10-01 16:21:21 -07:00
James Yonan
f3e9dbde86 Added OPENVPN_FMT(...) macro. 2015-10-01 16:20:15 -07:00
James Yonan
e6d27bc57e In format.hpp, added specializations for bool. 2015-10-01 16:18:45 -07:00
James Yonan
96866ac7e1 format.hpp:
* Added static polymorphic sink for print formatting in
  print_formatted_detail::Output<T> where T can be
  std::string or std::ostringstream

* By default printfmt() uses:

  PrintFormatted<std::string> pf(fmt, 256);

* prune openvpn::to_string() methods prior to removal
  (obsoleted by C++11 std::to_string())
2015-09-25 11:39:12 -07:00
James Yonan
5885b35731 In format.hpp:
(1) Create new versions of to_string() method:
    (a) for numeric types, dispatch to std::to_string()
    (b) for string, char, and nullptr_t types, handle directly
    (c) for other types, use std::ostringstream

(2) Create vararg methods prints, print, and printd
    for printing argument lists.

(3) Create method printfmt() with string formatting
    similar to sprintf but fully type-safe.
    usage: printfmt(<format_string>, args...)
    options:
      %s formats any argument regardless of type.
      %r formats any argument regardless of type and quotes it.
      %% formats '%'
2015-09-24 13:52:24 -07:00
James Yonan
e2e55ba6ec Forgot to specify "inline" for to_string() method
in common/format.hpp.
2015-08-24 21:06:23 -07:00
James Yonan
c2c7292a70 Updated copyright to 2015. 2015-01-06 12:56:21 -07:00
James Yonan
2c6d972ad6 Added AGPL copyright/licensing language. 2014-07-20 21:22:06 -06:00
James Yonan
4d9a751af2 Added head comments to all source files.
Minor reorganization of unicode code.
2012-11-23 06:18:43 +00:00
James Yonan
48ab9cbbe9 Added our own system() implementation to allow args to be passed as
array instead of concatenated string, and to resolve issue on OS X
where signals were being ignored after system() was called.

C++ iterators incremented in a for statement should usually use
a preincrement syntax.
2012-09-12 04:24:05 +00:00