ARB
Classes | Typedefs | Functions
arb_strarray.h File Reference
#include <arbtools.h>
#include "arb_string.h"
#include <algorithm>
#include <cstdlib>
Include dependency graph for arb_strarray.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CharPtrArray
 
class  FINAL_TYPE< SEQTYPE >
 xml element More...
 
class  ConstStrArray
 

Typedefs

typedef int(* CharPtrArray_compare_fun )(const void *p0, const void *p1, void *client_data)
 

Functions

 MARK_NONFINAL_CLASS (ConstStrArray)
 
void GBT_splitNdestroy_string (ConstStrArray &names, char *&namelist, const char *separator, bool dropEmptyTokens)
 
void GBT_splitNdestroy_string (ConstStrArray &dest, char *&namelist, char separator)
 
void GBT_split_string (ConstStrArray &dest, const char *namelist, const char *separator, bool dropEmptyTokens)
 
void GBT_split_string (ConstStrArray &dest, const char *namelist, char separator)
 
charGBT_join_strings (const CharPtrArray &strings, char separator)
 

Typedef Documentation

typedef int(* CharPtrArray_compare_fun)(const void *p0, const void *p1, void *client_data)

Definition at line 29 of file arb_strarray.h.

Function Documentation

MARK_NONFINAL_CLASS ( ConstStrArray  )
void GBT_splitNdestroy_string ( ConstStrArray names,
char *&  namelist,
const char separator,
bool  dropEmptyTokens 
)

Split 'namelist' into an array of substrings at each member of 'separator'.

Parameters
namespointers to split parts (into namelist)
nameliststring containing separator delimited parts
separatorcontains all characters handled as separators
dropEmptyTokensif true, empty tokens will be skipped

Example:

1 ConstStrArray array;
2 char *list = ARB_strdup("Peter;Paul;Mary");
3 GBT_splitNdestroy_string(array, list, ";", false);
4 // array[1] contains "Paul"

ownership of namelist is transferred to 'names'

Definition at line 49 of file arb_strarray.cxx.

References NULp, ConstStrArray::put(), s, and ConstStrArray::set_memblock().

Referenced by AW_init_color_group_defaults(), clear_comment_cb(), create_probe_design_variables(), fill_boolrules_array_from_AWAR(), fill_with_source_sais(), GBT_load_colorset(), GBT_split_string(), GBT_splitNdestroy_string(), get_selected_configs_from_awar(), parseCSV(), PT_start_design(), read_references(), refresh_inputfield_selbox_cb(), and string2WordSet().

void GBT_splitNdestroy_string ( ConstStrArray dest,
char *&  namelist,
char  separator 
)

Definition at line 92 of file arb_strarray.cxx.

References GBT_splitNdestroy_string().

void GBT_split_string ( ConstStrArray dest,
const char namelist,
const char separator,
bool  dropEmptyTokens 
)
inline
void GBT_split_string ( ConstStrArray dest,
const char namelist,
char  separator 
)
inline

Definition at line 237 of file arb_strarray.h.

References ARB_strdup(), and GBT_splitNdestroy_string().

char* GBT_join_strings ( const CharPtrArray strings,
char  separator 
)

Joins a NULp-terminated array of 'char*' into one string

Parameters
stringsarray of strings to join (maybe generated using GBT_split_string() or GBT_splitNdestroy_string)
separatoris put between the concatenated strings (pass 0 to join w/o separator)
Returns
heap-copy of joined strings

Definition at line 98 of file arb_strarray.cxx.

References arb_assert, ARB_strdup(), GBS_chrcat(), GBS_strcat(), GBS_strclose(), GBS_stropen(), and implicated.

Referenced by cbtype2readable(), clear_comment_cb(), correct_managed_configsets_cb(), remove_from_configs(), sai_seletion_changed_cb(), update_rulesAwar(), updateChangedInputFields(), test_runtool::valgrinded_pipe_command(), write_configs_to_awar(), and write_references().