~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/cslib/CSStrUtil.h

  • Committer: lbieber
  • Date: 2010-10-02 19:48:35 UTC
  • mfrom: (1730.6.19 drizzle-make-lcov)
  • Revision ID: lbieber@orisndriz08-20101002194835-q5zd9qc4lvx1xnfo
Merge Hartmut - clean up lex, now require flex to build, also "make lcov" improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany
 
1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
2
2
 *
3
3
 * PrimeBase Media Stream for MySQL
4
4
 *
14
14
 *
15
15
 * You should have received a copy of the GNU General Public License
16
16
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
18
 *
19
19
 * Original author: Paul McCullagh (H&G2JCtL)
20
20
 * Continued development: Barry Leslie
29
29
#ifndef __CSUTIL_H__
30
30
#define __CSUTIL_H__
31
31
 
 
32
using namespace std;
 
33
 
32
34
#include "CSDefs.h"
33
35
 
34
 
const char      *cs_version();
35
 
 
36
36
void            cs_strcpy(size_t size, char *d, const char *s, size_t len);
37
37
void            cs_strcpy(size_t size, char *d, const char *s);
38
 
void            cs_strcpy_dottt(size_t size, char *d, const char *s, size_t len);
39
38
void            cs_strcpy_left(size_t size, char *d, const char *s, char ch);
40
39
void            cs_strcpy_right(size_t size, char *d, const char *s, char ch);
41
40
void            cs_strcat(size_t size, char *d, const char *s);
48
47
void            cs_strcat(size_t size, char *to, uint64_t i);
49
48
void            cs_strcat_hex(size_t size, char *to, uint64_t i);
50
49
void            cs_format_context(size_t size, char *buffer, const char *func, const char *file, int line);
51
 
int                     cs_path_depth(const char *path);
52
 
bool            cs_fixed_pattern(const char *path);
53
 
bool            cs_match_patern(const char *pattern, const char *str, bool ignore_case);
54
50
char            *cs_last_name_of_path(const char *path, int count);
55
51
char            *cs_last_name_of_path(const char *path);
56
 
char            *cs_last_directory_of_path(const char *path);
 
52
char            *cs_last_directory_of_path(char *path);
57
53
const char      *cs_find_extension(const char *file_name);
58
54
void            cs_remove_extension(char *file_name);
59
55
bool            cs_is_extension(const char *file_name, const char *ext);
68
64
char            *cs_strdup(int value);
69
65
char            *cs_strdup(const char *in_str, size_t len);
70
66
bool            cs_starts_with(const char *cstr, const char *w_cstr);
71
 
bool            cs_ends_with(const char *cstr, const char *w_cstr);
72
67
void            cs_make_absolute_path(size_t max, char *path, const char *rel_path, const char *cwd);
73
 
void            cs_replace_string(size_t size, char *into, const char *find_str, const char *str);
74
68
void            cs_replace_string(size_t size, char *into, const char ch, const char *str);
75
69
int64_t         cs_str_to_int8(const char *ptr, bool *overflow);
76
 
int64_t         cs_byte_size_to_int8(const char *ptr, bool *invalid = NULL);
77
 
uint64_t        cs_str_to_word8(const char *ptr, bool *overflow = NULL);
78
 
size_t          cs_hex_to_bin(size_t size, void *bin, const char *hex);
 
70
int64_t         cs_byte_size_to_int8(const char *ptr);
 
71
uint64_t        cs_str_to_word8(const char *ptr, bool *overflow);
79
72
size_t          cs_hex_to_bin(size_t size, void *bin, size_t len, const char *hex);
80
 
void            cs_bin_to_hex(size_t size, char *hex, size_t len, const void *bin);
 
73
size_t          cs_bin_to_hex(size_t size, char *hex, size_t len, const void *bin);
81
74
void            cs_strToUpper(char *ptr);
82
75
void            cs_strToLower(char *ptr);
83
76
 
84
 
const char *cs_version();
85
 
bool            cs_str_to_value(const char *ptr, uint32_t *value, uint8_t base);
86
77
#endif