Loading [MathJax]/extensions/TeX/AMSsymbols.js
LAL 7.7.0.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
StringVector.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008 Reinhard Prix
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19
20#ifndef _STRINGVECTOR_H /* Double-include protection. */
21#define _STRINGVECTOR_H
22
23/* C++ protection. */
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/*---------- INCLUDES ----------*/
29#include <stdarg.h>
30
31#include <lal/LALDatatypes.h>
32
33/**
34 * \author Reinhard Prix
35 * \date 2008
36 * \defgroup StringVector_h Header StringVector.h
37 * \ingroup lal_factories
38 *
39 * \brief Creation/destruction/manipulation API for \c LALStringVector objects,
40 * which are just LAL-type vectors of CHAR * pointers.
41 *
42 * ### Synopsis ###
43 *
44 * \code
45 * #include <lal/StringVector.h>
46 * \endcode
47 *
48 */
49/** @{ */
50
51/*---------- DEFINES ----------*/
52
53/*----- Error-codes -----*/
54/*---------- exported types ----------*/
55/*---------- Global variables ----------*/
56/*---------- exported prototypes [API] ----------*/
57
58#ifdef SWIG /* SWIG interface directives */
59SWIGLAL(VARIABLE_ARGUMENT_LIST(XLALCreateStringVector, CHAR*, NULL));
60#endif /* SWIG */
61
62LALStringVector *XLALCreateStringVector ( const CHAR *str1, ... );
67
68char *XLALConcatStringVector( const LALStringVector *strings, const char *sep );
69LALStringVector *XLALParseStringVector( const char *string, const char *delim );
70
72INT4 XLALFindStringInVector ( const char *needle, const LALStringVector *haystack );
73
74char *XLALDeblankString ( const char *start, UINT4 len );
75
76/** @} */
77
78#ifdef __cplusplus
79}
80#endif
81/* C++ protection. */
82
83#endif /* Double-include protection. */
char CHAR
One-byte signed integer, see Headers LAL(Atomic)Datatypes.h for more details.
uint32_t UINT4
Four-byte unsigned integer.
int32_t INT4
Four-byte signed integer.
void XLALDestroyStringVector(LALStringVector *vect)
XLAL-interface: Free a string-vector ;)
Definition: StringVector.c:204
char * XLALDeblankString(const char *start, UINT4 len)
Copy (and allocate) string from 'start' with length 'len', removing all starting- and trailing blanks...
Definition: StringVector.c:330
LALStringVector * XLALAppendString2Vector(LALStringVector *vect, const CHAR *string)
Append the given string to the string-vector (XLAL interface), return pointer to the resulting string...
Definition: StringVector.c:47
LALStringVector * XLALCreateStringVector(const CHAR *str1,...)
Create a StringVector from the list of strings passed as arguments.
Definition: StringVector.c:100
LALStringVector * XLALParseStringVector(const char *string, const char *delim)
Parse 'string' into a string vector of tokens, delimited by the characters 'delim'.
Definition: StringVector.c:280
LALStringVector * XLALCreateEmptyStringVector(UINT4 length)
Create an empty string vector of the given length.
Definition: StringVector.c:164
int XLALSortStringVector(LALStringVector *strings)
Sort string-vector alphabetically in place
Definition: StringVector.c:312
char * XLALConcatStringVector(const LALStringVector *strings, const char *sep)
Concatenate a string vector 'strings', separated by the string 'sep', into a single string.
Definition: StringVector.c:246
INT4 XLALFindStringInVector(const char *needle, const LALStringVector *haystack)
Search for string 'needle' in string-vector 'haystack', return index to first matching vector element...
Definition: StringVector.c:370
LALStringVector * XLALCopyStringVector(const LALStringVector *vect)
Create a copy of a string vector.
Definition: StringVector.c:189
Vector of type CHAR*, ie 'strings', see DATATYPE-Vector types for more details.
Definition: LALDatatypes.h:82