~ubuntu-branches/debian/sid/gsmartcontrol/sid

« back to all changes in this revision

Viewing changes to src/hz/string_format.h

  • Committer: Bazaar Package Importer
  • Author(s): Giuseppe Iuculano
  • Date: 2011-07-15 14:59:29 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110715145929-2o1o4phm5w1rwttz
Tags: 0.8.6-1
* [dbb993d] Updated my email address and removed DM-Upload-Allowed
  control field
* [b681b5b] Imported Upstream version 0.8.6
* [ab9bb7a] Refreshed patches
* [a909506] Bump to Standards-Version 3.9.2, no changes needed
* [48dd13d] Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**************************************************************************
2
2
 Copyright:
3
 
      (C) 2008 - 2009  Alexander Shaduri <ashaduri 'at' gmail.com>
 
3
      (C) 2008 - 2011  Alexander Shaduri <ashaduri 'at' gmail.com>
4
4
 License: See LICENSE_zlib.txt file
5
5
***************************************************************************/
6
6
 
14
14
#include <cstddef>  // std::size_t, std::ptrdiff_t
15
15
 
16
16
#include "cstdint.h"  // (u)intmax_t
17
 
#include "system_specific.h"  // HZ_FUNC_PRINTF_CHECK
18
 
#include "string_sprintf.h"  // string_sprintf
 
17
#include "string_sprintf.h"  // string_sprintf, HZ_FUNC_STRING_SPRINTF_CHECK
19
18
#include "stream_cast.h"  // stream_cast<>
20
19
#include "local_algo.h"  // returning_binary_search
21
20
 
30
29
 
31
30
// Note: These functions use system *printf family of functions.
32
31
 
33
 
// Note: On MinGW there is no support for %Lf (long double).
34
 
// Also, you have to use %I64d instead of %lld for long long int
 
32
// Note: If using mingw without __USE_MINGW_ANSI_STDIO,
 
33
// you MUST cast long double to double and use %f instead of %Lf;
 
34
// also you have to use %I64d instead of %lld for long long int
35
35
// and %I64u instead of %llu for unsigned long long int.
36
36
// You can use hz::number_to_string() as a workaround.
37
37
 
 
38
// FIXME: Check string_sprintf() features through HAVE_STRING_SPRINTF_*
 
39
// macros and supply the necessary specifiers / casts.
 
40
 
38
41
 
39
42
namespace hz {
40
43
 
48
51
 
49
52
// Public API:
50
53
 
51
 
inline internal::FormatState string_format(std::string& s, const char* format) HZ_FUNC_PRINTF_CHECK(2, 0);
 
54
inline internal::FormatState string_format(std::string& s, const char* format) HZ_FUNC_STRING_SPRINTF_CHECK(2, 0);
52
55
 
53
56
inline internal::FormatState string_format(std::string& s, const std::string& format);
54
57