diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2005-03-28 22:46:38 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2005-03-28 22:46:38 (GMT) |
commit | 1816011791a1db7095e57d3f6e6bda6d51e89f7a (patch) | |
tree | 7ca752611ddb97cd1a78c5200823b2c60918d628 /Source/kwsys/SystemTools.hxx.in | |
parent | 11965ebd34a41c6c1c452ae87134dd8a2221d5e2 (diff) | |
download | CMake-1816011791a1db7095e57d3f6e6bda6d51e89f7a.zip CMake-1816011791a1db7095e57d3f6e6bda6d51e89f7a.tar.gz CMake-1816011791a1db7095e57d3f6e6bda6d51e89f7a.tar.bz2 |
ENH: move EstimateFormatLength to kwsys
Diffstat (limited to 'Source/kwsys/SystemTools.hxx.in')
-rw-r--r-- | Source/kwsys/SystemTools.hxx.in | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index 522410d..2656e33 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -22,6 +22,7 @@ #include <@KWSYS_NAMESPACE@/Configure.h> #include <sys/types.h> +#include <stdarg.h> #if defined( _MSC_VER ) typedef unsigned short mode_t; @@ -188,6 +189,17 @@ public: static char* AppendStrings( const char* str1, const char* str2, const char* str3); + /** + * Estimate the length of the string that will be produced + * from printing the given format string and arguments. The + * returned length will always be at least as large as the string + * that will result from printing. + * WARNING: since va_arg is called to iterate of the argument list, + * you will not be able to use this 'ap' anymore from the beginning. + * It's up to you to call va_end though. + */ + static int EstimateFormatLength(const char *format, va_list ap); + /** ----------------------------------------------------------------- * Filename Manipulation Routines * ----------------------------------------------------------------- |