![]() |
|
|||
File indexing completed on 2025-06-30 08:43:33
0001 // Copyright (c) 1998-1999 Matra Datavision 0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0003 // 0004 // This file is part of Open CASCADE Technology software library. 0005 // 0006 // This library is free software; you can redistribute it and/or modify it under 0007 // the terms of the GNU Lesser General Public License version 2.1 as published 0008 // by the Free Software Foundation, with special exception defined in the file 0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0010 // distribution for complete text of the license and disclaimer of any warranty. 0011 // 0012 // Alternatively, this file may be used under the terms of Open CASCADE 0013 // commercial license or contractual agreement. 0014 0015 //!@file 0016 //! Functions working with plain C strings 0017 0018 #ifndef _Standard_CString_HeaderFile 0019 #define _Standard_CString_HeaderFile 0020 0021 #include <Standard_Macro.hxx> 0022 0023 #include <stdarg.h> 0024 #include <stdio.h> 0025 #include <string.h> 0026 0027 #if defined(_MSC_VER) 0028 #if !defined(strcasecmp) 0029 #define strcasecmp _stricmp 0030 #endif 0031 #if !defined(strncasecmp) 0032 #define strncasecmp _strnicmp 0033 #endif 0034 #endif 0035 0036 // C++ only definitions 0037 #ifdef __cplusplus 0038 0039 #include <Standard_TypeDef.hxx> 0040 0041 //! Returns Standard_True if two strings are equal 0042 inline Standard_Boolean IsEqual (const Standard_CString theOne, const Standard_CString theTwo) 0043 { 0044 return strcmp (theOne, theTwo) == 0; 0045 } 0046 0047 #endif /* __cplusplus */ 0048 0049 #ifdef __cplusplus 0050 extern "C" { 0051 #endif /* __cplusplus */ 0052 0053 //! Equivalent of standard C function atof() that always uses C locale 0054 Standard_EXPORT double Atof (const char* theStr); 0055 0056 //! Optimized equivalent of standard C function strtod() that always uses C locale 0057 Standard_EXPORT double Strtod (const char* theStr, char** theNextPtr); 0058 0059 //! Equivalent of standard C function printf() that always uses C locale 0060 Standard_EXPORT int Printf (const char* theFormat, ...); 0061 0062 //! Equivalent of standard C function fprintf() that always uses C locale 0063 Standard_EXPORT int Fprintf (FILE* theFile, const char* theFormat, ...); 0064 0065 //! Equivalent of standard C function sprintf() that always uses C locale 0066 Standard_EXPORT int Sprintf (char* theBuffer, const char* theFormat, ...); 0067 0068 //! Equivalent of standard C function vsprintf() that always uses C locale. 0069 //! Note that this function does not check buffer bounds and should be used with precaution measures 0070 //! (only with format fitting into the buffer of known size). 0071 //! @param theBuffer [in] [out] string buffer to fill 0072 //! @param theFormat [in] format to apply 0073 //! @param theArgList [in] argument list for specified format 0074 //! @return the total number of characters written, or a negative number on error 0075 Standard_EXPORT int Vsprintf (char* theBuffer, const char* theFormat, va_list theArgList); 0076 0077 #ifdef __cplusplus 0078 } 0079 #endif /* __cplusplus */ 0080 0081 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |