cta_string.h File Reference

Interface description of the default COSTA string component. More...

#include "cta_system.h"
#include "cta_handles.h"
#include "cta_datatypes.h"

Go to the source code of this file.

Functions

CTAEXPORT int CTA_String_Create (CTA_String *hstring)
 Create a new COSTA string instance.
CTAEXPORT int CTA_String_Copy (CTA_String *hto, CTA_String hfrom)
 Create a new COSTA string that is a copy of an existing one.
CTAEXPORT int CTA_String_Free (CTA_String *hstring)
 Free the COSTA string instance.
CTAEXPORT int CTA_String_GetLength (CTA_String hstring, int *len)
 Get the number of characters in string.
CTAEXPORT int CTA_String_Set (CTA_String hstring, const char *str)
 Set the string to new content.
CTAEXPORT int CTA_String_Get (CTA_String hstring, char *str)
 Get a copy of the string.
CTAEXPORT int CTA_String_GetValue (CTA_String hstring, void *value, CTA_Datatype datatype)
 Get the (scalar) value of a string.
CTAEXPORT int CTA_String_Conc (CTA_String istring, CTA_String xstring)
 Create new string that is a concatination of existing strings.
CTAEXPORT char * CTAI_String_GetPtr (CTA_String hstring)
 Get a pointer to the contents of the string (INTERNAL USE).
CTAEXPORT int CTA_String_Import (CTA_String hstring, CTA_Handle usrdata)
 Imports string.
CTAEXPORT int CTA_String_Export (CTA_String hstring, CTA_Handle usrdata)
 Exports length of string and string itself.
CTAEXPORT int CTA_String_Equals_Char (CTA_String hstring, const char *str0)
 Check whether string is equal to COSTA string.
CTAEXPORT int CTA_Strings_Equal (CTA_String hstring1, CTA_String hstring2)
 Check whether two COSTA strings are equal.
CTAEXPORT int CTA_String_Duplicate (CTA_String hfrom, CTA_String *hto)
 Create a duplication of a COSTA string.

Detailed Description

Interface description of the default COSTA string component.

Utilities including most of the basic string operations and access to the string data itself.

Definition in file cta_string.h.


Function Documentation

CTAEXPORT int CTA_String_Conc ( CTA_String  istring,
CTA_String  xstring 
)

Create new string that is a concatination of existing strings.

Parameters:
istring IO handle of the string (first string in concatination) and whole concatinated string on return
xstring I handle of the second string (extension string)
Returns:
CTA_OK if successful
CTAEXPORT int CTA_String_Copy ( CTA_String hto,
CTA_String  hfrom 
)

Create a new COSTA string that is a copy of an existing one.

Parameters:
hto O receives the handle of the created string
hfrom I handle of string to copy
Returns:
CTA_OK if successful
CTAEXPORT int CTA_String_Create ( CTA_String hstring  ) 

Create a new COSTA string instance.

Parameters:
hstring O handle of created string
Returns:
CTA_OK if successful
CTAEXPORT int CTA_String_Duplicate ( CTA_String  hfrom,
CTA_String hto 
)

Create a duplication of a COSTA string.

Parameters:
hfrom I handle of string to copy
hto O handle of created string
Returns:
CTA_OK if successful
CTAEXPORT int CTA_String_Equals_Char ( CTA_String  hstring,
const char *  str0 
)

Check whether string is equal to COSTA string.

Parameters:
hstring I handle of the string
str0 I string to compare hsting with
Returns:
CTA_TRUE/CTA_FALSE
Note:
Only CTA_Pack is currently supported fot usrdata
CTAEXPORT int CTA_String_Export ( CTA_String  hstring,
CTA_Handle  usrdata 
)

Exports length of string and string itself.

Supports: pack objects (usrdata must be handle of pack object to export to)

Parameters:
hstring I handle of the string
usrdata IO configuration of export
Returns:
CTA_OK if successful
Note:
Only CTA_Pack is currently supported fot usrdata
CTAEXPORT int CTA_String_Free ( CTA_String hstring  ) 

Free the COSTA string instance.

Note:
Parameters:
hstring IO handle of the string instance, replaced by CTA_NULL on return
Returns:
CTA_OK if successful
CTAEXPORT int CTA_String_Get ( CTA_String  hstring,
char *  str 
)

Get a copy of the string.

Note:
It is the responsibility of the caller making str large enough to hold the string and trailing 0-character.
Parameters:
hstring I handle of the string
str O buffer that receives a copy of the string including trailing 0-character
Returns:
CTA_OK if successful
CTAEXPORT int CTA_String_GetLength ( CTA_String  hstring,
int *  len 
)

Get the number of characters in string.

Note:
The returned length is the number of characters excluding the 0-character.
Parameters:
hstring I handle of the string
len O receives the number of characters in string
Returns:
CTA_OK if successful
CTAEXPORT int CTA_String_GetValue ( CTA_String  hstring,
void *  value,
CTA_Datatype  datatype 
)

Get the (scalar) value of a string.

Note:
It is the responsibility of the caller that parameter value is large enough to hold the value as specified by the datatype.
Parameters:
hstring I handle of the string
value O receives the value
datatype I data type of value
Returns:
CTA_OK if successful
CTAEXPORT int CTA_String_Import ( CTA_String  hstring,
CTA_Handle  usrdata 
)

Imports string.

Supports: pack objects (usrdata must be handle of pack object to import from)

Parameters:
hstring IO handle of the string
usrdata I configuration of import
Returns:
CTA_OK if successful
Note:
Only CTA_Pack is currently supported fot usrdata
CTAEXPORT int CTA_String_Set ( CTA_String  hstring,
const char *  str 
)

Set the string to new content.

Parameters:
hstring IO handle of the string
str I new content
Returns:
CTA_OK if successful
CTAEXPORT int CTA_Strings_Equal ( CTA_String  hstring1,
CTA_String  hstring2 
)

Check whether two COSTA strings are equal.

Parameters:
hstring1 I handle of first string
hstring2 I handle of second string
Returns:
CTA_TRUE/CTA_FALSE
Note:
Only CTA_Pack is currently supported fot usrdata
CTAEXPORT char* CTAI_String_GetPtr ( CTA_String  hstring  ) 

Get a pointer to the contents of the string (INTERNAL USE).

Parameters:
hstring I handle of the string
Returns:
pointer to the string contents

Generated on 4 Mar 2014 for OpenDA by  doxygen 1.6.1