2 * NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
4 * Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
6 * Tecplot hereby grants OpenCFD limited authority to distribute without
7 * alteration the source code to the Tecplot Input/Output library, known
8 * as TecIO, as part of its distribution of OpenFOAM and the
9 * OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
10 * granted access to the TecIO source code, and may redistribute it for the
11 * purpose of maintaining the converter. However, no authority is granted
12 * to alter the TecIO source code in any form or manner.
14 * This limited grant of distribution does not supersede Tecplot, Inc.'s
15 * copyright in TecIO. Contact Tecplot, Inc. for further information.
18 * 3535 Factoria Blvd, Ste. 550
19 * Bellevue, WA 98006, USA
20 * Phone: +1 425 653 1200
21 * http://www.tecplot.com/
25 ******************************************************************
26 ******************************************************************
28 ****** (C) 1988-2008 Tecplot, Inc. *******
30 ******************************************************************
31 ******************************************************************
37 #if defined STRUTILMODULE
54 #if defined TECPLOTKERNEL
55 /* CORE SOURCE CODE REMOVED */
60 EXTERN
void FormatStringBufferCleanup(void);
63 * This is a helper function for FormatString or any other functions that want
64 * to format a string based on a format string followed by a set of arguments.
65 * See FormatString or ErrMsg functions for example usage.
70 * Variable argument list already fetched using va_start().
73 * Allocated string with the formatted string or NULL if it failed.
75 EXTERN
char *vFormatString(const char *Format
,
79 * Formats a string using the specified C format string.
84 * Any arguments needed by the C format string.
87 * Allocated string with the formatted string or NULL if it failed. The
88 * client is responsible for deallocating the resource.
90 EXTERN
char *FormatString(tecplot::strutil::TranslatedString Format
,
91 ...); /* 0 or more variable arguments */
94 * Formats a string using the specified C format string and places the result
95 * in the string buffer.
98 * String buffer to receive the formatted string.
102 * Any arguments needed by the C format string.
105 * Upon successful return, these functions return the number of characters
106 * printed, not including the trailing '\0' used to end output to strings. If
107 * unsuccessful -1 is returned.
109 EXTERN
int FormatString(std::string
& Buffer
,
110 tecplot::strutil::TranslatedString Format
111 ...); /* 0 or more variable arguments */
112 EXTERN
char *DupString(tecplot::strutil::TranslatedString String
);
113 EXTERN
void CopySubString(char *Target
,
120 EXTERN
void ReplaceCharInString(char *S
,
125 EXTERN
void MakeStringLowerCase(char *str
);
126 EXTERN
void MakeStringUpperCase(char *str
);
127 EXTERN
char *TrimLeadAndTrailSpaces(char *String
);
128 EXTERN
char *StringFlushLeft(char *String
);
129 EXTERN
char *StringTruncate(char *String
,
130 LgIndex_t MaxLength
);
131 EXTERN
char *StringTrimAndTruncate(char *String
,
132 LgIndex_t MaxLength
);
135 EXTERN StringList_pa
LineBreakString(const char *String
,
136 UInt32_t WrapMargin
);
139 EXTERN Boolean_t
MatchKey(char *StringToMatch
,
141 EXTERN
void RemoveSeparator(const char **CPtr
);
142 EXTERN
void SkipWhiteSpace(const char **CPtr
);
143 EXTERN
void SkipNonWhiteSpace(char **CPtr
);
144 EXTERN
const char *ustrstr(const char *s1
,
146 EXTERN
int ustrncmp(const char *s1
,
149 EXTERN
int ustrcmp(const char *s1
,
152 /* InternalResetString should not be used directly (use ResetString macro) */
153 #if !defined NO_ASSERTS
154 EXTERN Boolean_t
InternalResetString(char **SBase
,
155 const char *NewString
,
156 Boolean_t IssueErrMsg
,
157 const char *FileName
,
159 # define ResetString(SBase, NewString, IssueErrMsg) InternalResetString( \
165 EXTERN Boolean_t
InternalResetString(char **SBase
,
166 const char *NewString
,
167 Boolean_t IssueErrMsg
);
168 # define ResetString(SBase, NewString, IssueErrMsg) InternalResetString( \
174 EXTERN Boolean_t
ScanForString(tecplot::strutil::Scanner
&scanner
,
175 std::string
&DestString
,
176 Boolean_t GrabEntireStringIncludingDelimiters
);
177 EXTERN Boolean_t
TackOnString(char **SBase
,
178 const char *StringToAdd
,
179 Boolean_t DeleteStringToAdd
,
180 Boolean_t ConvertNewlineToAscii
);
181 EXTERN Boolean_t
TackOnConstString(char **SBase
,
182 const char *StringToAdd
,
183 Boolean_t ConvertNewlineToAscii
);
184 EXTERN Boolean_t
TackOnChar(char **SBase
,
186 EXTERN Boolean_t
ReplaceNewlineWithBackslashN(char **String
);
187 EXTERN Boolean_t
ReplaceBackslashNWithNewline(char **S
);
189 EXTERN Boolean_t
EscapeOutDelimitersInString(char **S
,
191 EXTERN Boolean_t
ScanForSymbol(tecplot::strutil::Scanner
&scanner
,
193 Boolean_t OnlySkipWhiteSpace
);
196 /* Newline Delimited Strings */
197 EXTERN
char *ConvertStringToNewlineDelimitedString(const char *OriginalString
);
198 EXTERN
char *ConvertNewlineDelimitedStringToQuotedString(const char *NewlineDelimitedString
,
199 Boolean_t SeparateInstructionsWithPlus
);
203 EXTERN
char *InsertNameAtPlaceHolder(char *BaseString
,
205 #if defined TECPLOTKERNEL
206 /* CORE SOURCE CODE REMOVED */
207 #if !defined NO_ASSERTS
208 #endif /* !NO_ASSERTS */
209 #endif //TECPLOTKERNEL
211 inline char* EndOfString(char* str
)
213 return str
+ strlen(str
);
215 inline char const* EndOfString(char const* str
)
217 return str
+ strlen(str
);