cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstCommon
cmnStrings.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
Author(s): Anton Deguet
6
Created on: 2009-11-08
7
8
(C) Copyright 2009-2020 Johns Hopkins University (JHU), All Rights Reserved.
9
10
--- begin cisst license - do not edit ---
11
12
This software is provided "as is" under an open source license, with
13
no warranty. The complete license can be found in license.txt and
14
http://www.cisst.org/cisst/license.txt.
15
16
--- end cisst license ---
17
18
*/
19
20
25
#pragma once
26
27
#ifndef _cmnStrings_h
28
#define _cmnStrings_h
29
30
#include <
cisstCommon/cmnPortability.h
>
31
#include <
cisstCommon/cmnExport.h
>
32
33
#include <string>
34
#include <vector>
35
#include <stdarg.h>
36
#include <stdio.h>
37
41
inline
int
cmn_snprintf
(
char
* destination,
size_t
size
,
const
char
* format, ...) {
42
va_list arguments;
43
va_start(arguments, format);
44
int
result;
45
#if (CISST_COMPILER == CISST_DOTNET2003)
46
result = _vsnprintf(destination,
size
, format, arguments);
47
#elif (CISST_COMPILER == CISST_DOTNET2005) || (CISST_COMPILER == CISST_DOTNET2008)
48
result = vsnprintf_s(destination,
size
, _TRUNCATE, format, arguments);
49
#else
50
result = vsnprintf(destination,
size
, format, arguments);
51
#endif
52
va_end(arguments);
53
return
result;
54
}
55
57
CISST_EXPORT
void
cmnStringReplaceAll
(std::string & userString,
58
const
std::string & oldString,
const
std::string & newString);
59
62
CISST_EXPORT
std::string
cmnStringToUnderscoreLower
(
const
std::string & input);
63
64
#endif
// _cmnStrings_h
cmnExport.h
Macros to export the symbols of cisstCommon (in a Dll).
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
cmnPortability.h
Portability across compilers and operating systems tools.
cmnStringReplaceAll
CISST_EXPORT void cmnStringReplaceAll(std::string &userString, const std::string &oldString, const std::string &newString)
cmnStringToUnderscoreLower
CISST_EXPORT std::string cmnStringToUnderscoreLower(const std::string &input)
cmn_snprintf
int cmn_snprintf(char *destination, size_t size, const char *format,...)
Definition
cmnStrings.h:41
size
size_type size(void) const
Definition
vctDynamicConstMatrixBase.h:228
Generated by
1.18.0