ARB
Classes | Functions | Variables
adstring.cxx File Reference
#include <arb_backtrace.h>
#include <arb_strbuf.h>
#include <arb_defs.h>
#include <arb_str.h>
#include "gb_key.h"
#include "gb_aci.h"
#include <SigHandler.h>
#include <execinfo.h>
#include <cstdarg>
#include <cctype>
#include <cerrno>
#include <ctime>
#include <setjmp.h>
#include <valgrind.h>
Include dependency graph for adstring.cxx:

Go to the source code of this file.

Classes

class  TextRef
 
class  TaggedContentParser
 

Functions

static charGBS_string_2_key_with_exclusions (const char *str, const char *additional)
 
charGBS_string_2_key (const char *str)
 
charGB_memdup (const char *source, size_t len)
 
__ATTR__USERESULT GB_ERROR check_key (const char *key, int len)
 
GB_ERROR GB_check_key (const char *key)
 
GB_ERROR GB_check_hkey (const char *key)
 
charGBS_escape_string (const char *str, const char *chars_to_escape, char escape_char)
 
charGBS_unescape_string (const char *str, const char *escaped_chars, char escape_char)
 
charGBS_eval_env (GB_CSTR p)
 
long GBS_gcgchecksum (const char *seq)
 
uint32_t GB_checksum (const char *seq, long length, int ignore_case, const char *exclude)
 
uint32_t GBS_checksum (const char *seq, int ignore_case, const char *exclude)
 
size_t GBS_shorten_repeated_data (char *data)
 
static TextRef textBetween (const TextRef &t1, const TextRef &t2)
 
static void g_bs_add_value_tag_to_hash (GB_HASH *hash, const char *tag, char *value)
 
static void g_bs_convert_string_to_tagged_hash_with_delete (GB_HASH *hash, char *s, char *default_tag, const char *del)
 
static GB_ERROR g_bs_convert_string_to_tagged_hash_with_rewrite (GB_HASH *hash, char *s, char *default_tag, const char *rtag, const char *aci, GBL_call_env &env)
 
static void g_bs_merge_tags (const char *tag, long, void *cd_sub_result)
 
static void g_bs_read_tagged_hash (const char *value, long subhash, void *cd_g_bs_collect_tags_hash)
 
static void g_bs_read_final_hash (const char *tag, long value, void *cd_merge_result)
 
static charg_bs_get_string_of_tag_hash (GB_HASH *tag_hash)
 
static long g_bs_free_hash_of_hashes_elem (const char *, long val, void *)
 
static void g_bs_free_hash_of_hashes (GB_HASH *hash)
 
charGBS_merge_tagged_strings (const char *s1, const char *tag1, const char *replace1, const char *s2, const char *tag2, const char *replace2)
 
charGBS_modify_tagged_string_with_ACI (const char *s, const char *dt, const char *tag, const char *aci, GBL_call_env &env)
 
charGB_read_as_tagged_string (GBDATA *gbd, const char *tagi)
 
void GBS_fwrite_string (const char *strngi, FILE *out)
 
static charGBS_fread_string (FILE *in)
 
charGBS_fconvert_string (char *buffer)
 
charGBS_replace_tabs_by_spaces (const char *text)
 
charGBS_trim (const char *str)
 
static chardated_info (const char *info)
 
charGBS_log_action_to (const char *comment, const char *action, bool stamp)
 
const charGBS_funptr2readable (void *funptr, bool stripARBHOME)
 

Variables

static const charEMPTY_KEY_NOT_ALLOWED = "Empty key is not allowed"
 
uint32_t crctab []
 

Function Documentation

static char* GBS_string_2_key_with_exclusions ( const char str,
const char additional 
)
static

Definition at line 31 of file adstring.cxx.

References ARB_strdup(), GB_KEY_LEN_MAX, and GB_KEY_LEN_MIN.

Referenced by GBS_string_2_key().

char* GBS_string_2_key ( const char str)
char* GB_memdup ( const char source,
size_t  len 
)
__ATTR__USERESULT GB_ERROR check_key ( const char key,
int  len 
)
inline

Definition at line 64 of file adstring.cxx.

References EMPTY_KEY_NOT_ALLOWED, GB_KEY_LEN_MAX, GB_KEY_LEN_MIN, GBS_global_string(), and NULp.

Referenced by GB_check_hkey(), and GB_check_key().

GB_ERROR GB_check_key ( const char key)
GB_ERROR GB_check_hkey ( const char key)
char* GBS_escape_string ( const char str,
const char chars_to_escape,
char  escape_char 
)

escape characters in 'str'

uses a special escape-method, which eliminates all 'chars_to_escape' completely from str (this makes further processing of the string more easy)

Parameters
strstring to escape
escape_charis the character used for escaping. For performance reasons it should be a character rarely used in 'str'.
chars_to_escapemay not contain 'A'-'Z' (these are used for escaping) and it may not be longer than 26 bytes
Returns
heap copy of escaped string

Inverse of GBS_unescape_string()

Definition at line 124 of file adstring.cxx.

References buffer, and gb_assert.

Referenced by colorDefChanged_callback(), insert_genes_of_organism(), and standard_list2file().

char* GBS_unescape_string ( const char str,
const char escaped_chars,
char  escape_char 
)

inverse of GB_escape_string() - for params see there

Definition at line 175 of file adstring.cxx.

References buffer, and gb_assert.

Referenced by colorDefTabNameChanged_callback(), parse_names_into_gene_struct(), and standard_file2list().

char* GBS_eval_env ( GB_CSTR  p)
long GBS_gcgchecksum ( const char seq)

Definition at line 246 of file adstring.cxx.

Referenced by gbl_gcgchecksum().

uint32_t GB_checksum ( const char seq,
long  length,
int  ignore_case,
const char exclude 
)
uint32_t GBS_checksum ( const char seq,
int  ignore_case,
const char exclude 
)
size_t GBS_shorten_repeated_data ( char data)

Definition at line 357 of file adstring.cxx.

References gb_assert, and orgLen.

Referenced by QUERY::DbQuery_update_list(), dump_internal(), QueryExpr::matches(), and SET_QUERIED().

static TextRef textBetween ( const TextRef t1,
const TextRef t2 
)
static

Definition at line 478 of file adstring.cxx.

References TextRef::get_data(), and TextRef::get_following().

Referenced by TextRef::partBefore().

static void g_bs_add_value_tag_to_hash ( GB_HASH hash,
const char tag,
char value 
)
static
static void g_bs_convert_string_to_tagged_hash_with_delete ( GB_HASH hash,
char s,
char default_tag,
const char del 
)
static
static GB_ERROR g_bs_convert_string_to_tagged_hash_with_rewrite ( GB_HASH hash,
char s,
char default_tag,
const char rtag,
const char aci,
GBL_call_env env 
)
static
static void g_bs_merge_tags ( const char tag,
long  ,
void *  cd_sub_result 
)
static

Definition at line 653 of file adstring.cxx.

References GBS_strstruct::cat(), and GBS_strstruct::put().

Referenced by g_bs_read_tagged_hash().

static void g_bs_read_tagged_hash ( const char value,
long  subhash,
void *  cd_g_bs_collect_tags_hash 
)
static
static void g_bs_read_final_hash ( const char tag,
long  value,
void *  cd_merge_result 
)
static
static char* g_bs_get_string_of_tag_hash ( GB_HASH tag_hash)
static
static long g_bs_free_hash_of_hashes_elem ( const char ,
long  val,
void *   
)
static

Definition at line 700 of file adstring.cxx.

References GBS_free_hash().

Referenced by g_bs_free_hash_of_hashes().

static void g_bs_free_hash_of_hashes ( GB_HASH hash)
static
char* GBS_merge_tagged_strings ( const char s1,
const char tag1,
const char replace1,
const char s2,
const char tag2,
const char replace2 
)
char* GBS_modify_tagged_string_with_ACI ( const char s,
const char dt,
const char tag,
const char aci,
GBL_call_env env 
)
char* GB_read_as_tagged_string ( GBDATA gbd,
const char tagi 
)
void GBS_fwrite_string ( const char strngi,
FILE *  out 
)

Definition at line 807 of file adstring.cxx.

Referenced by gb_write_one_child().

static char* GBS_fread_string ( FILE *  in)
static

Definition at line 849 of file adstring.cxx.

References GBS_strstruct::put(), and GBS_strstruct::release_memfriendly().

char* GBS_fconvert_string ( char buffer)

Definition at line 880 of file adstring.cxx.

References buffer, gb_assert, and NULp.

Referenced by gb_parse_ascii_rek().

char* GBS_replace_tabs_by_spaces ( const char text)

Definition at line 923 of file adstring.cxx.

References GBS_strstruct::put(), and GBS_strstruct::release_memfriendly().

Referenced by awt_aps_go(), and awt_aps_text_changed().

char* GBS_trim ( const char str)
static char* dated_info ( const char info)
static

Definition at line 958 of file adstring.cxx.

References ARB_strdup(), GBS_global_string_copy(), arb_test::nl(), and NULp.

Referenced by GBS_log_action_to().

char* GBS_log_action_to ( const char comment,
const char action,
bool  stamp 
)

concatenates 'comment' and 'action'. '
' is appended to existing 'comment' and/or 'action' (if missing).

Parameters
commentmay be NULp (=> result is 'action')
actionmay NOT be NULp
stamptrue -> prefix current timestamp in front of 'action'
Returns
heap copy of concatenation

Definition at line 976 of file adstring.cxx.

References GBS_strstruct::cat(), dated_info(), GBS_strstruct::put(), and GBS_strstruct::release_memfriendly().

Referenced by GBT_log_to_tree_remark(), ConsensusTreeBuilder::get_tree_remark(), nt_create_configuration(), EDB_root_bact::save_current_config(), TREE_load(), and TREE_write_Newick().

const char* GBS_funptr2readable ( void *  funptr,
bool  stripARBHOME 
)

Definition at line 1007 of file adstring.cxx.

References ARB_strBeginsWith(), and GB_getenvARBHOME().

Referenced by TypedDatabaseCallback::get_info().

Variable Documentation

const char* EMPTY_KEY_NOT_ALLOWED = "Empty key is not allowed"
static

Definition at line 62 of file adstring.cxx.

Referenced by check_key(), and GB_check_hkey().

uint32_t crctab[]

Definition at line 264 of file adstring.cxx.

Referenced by GB_checksum().