Oyranos  git-devel
Oyranos is a full featured Color Management System
Macros | Functions
oyjl_string.h File Reference

OyjlCore API provides a platformindependent C interface for string helpers. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "oyjl_version.h"

Macros

#define OYJL_COMPARE_EXACT   0x01
 
#define OYJL_COMPARE_CASE   0x02
 
#define OYJL_NO_INDEX   0x20
 omit index resolving by squared brackets [] and escape them More...
 
#define OYJL_QUOTE   0x40
 quotation marks '"' More...
 
#define OYJL_NO_BACKSLASH   0x80
 skip back slash '\' escaping More...
 
#define OYJL_REVERSE   0x100
 undo More...
 
#define OYJL_REGEXP   0x200
 handle regexp sequences More...
 
#define OYJL_JSON_VALUE   0x400
 flat to obtain only keys More...
 

Functions

char ** oyjlStringSplit (const char *text, const char delimiter, int *count, void *(*alloc)(size_t))
 convert a string into list More...
 
char ** oyjlStringSplit2 (const char *text, const char *delimiter, const char *(splitFunc)(const char *text, const char *delimiter, int *length), int *count, int **index, void *(*alloc)(size_t))
 convert a string into list More...
 
int oyjlStringFind (const char *text, const char *pattern, int flags)
 Match a string from pattern. More...
 
int oyjlStringSplitFind (const char *set, const char *delimiters, const char *pattern, int flags, char **result, void *(*alloc)(size_t), void(*deAlloc)(void *))
 Find a sub string in a delimited list. More...
 
int oyjlStringSplitUTF8 (const char *text, char ***mbchars, void *(*alloc)(size_t))
 split letters of a UTF-8 string More...
 
char * oyjlStringCopy (const char *string, void *(*alloc)(size_t))
 duplicate a string with custom allocator More...
 
char * oyjlStringAppendN (const char *text, const char *append, int append_len, void *(*alloc)(size_t size))
 append to the string end More...
 
void oyjlStringAddN (char **text, const char *append, int append_len, void *(*alloc)(size_t), void(*deAlloc)(void *))
 append to the string end More...
 
int oyjlStringReplace (char **text, const char *search, const char *replacement, void *(*alloc)(size_t), void(*deAlloc)(void *))
 substitute pattern in a string More...
 
void oyjlStringListRelease (char ***l, int size, void(*deAlloc)(void *))
 free a string list More...
 
void oyjlStringListFreeDoubles (char **list, int *list_n, void(*deAlloc)(void *))
 filter doubles out More...
 
void oyjlStringListFree (char **list, int *list_n, int start, int count, void(*deAlloc)(void *))
 remove elements from array More...
 
void oyjlStringListAddList (char ***list, int *n, const char **append, int n_app, void *(*alloc)(size_t), void(*deAlloc)(void *))
 append a string list to an other and handle memory More...
 
char ** oyjlStringListCatList (const char **list, int n_alt, const char **append, int n_app, int *count, void *(*alloc)(size_t))
 append a string list to an other string list More...
 
void oyjlStringListPush (char ***list, int *n, const char *string, void *(*alloc)(size_t), void(*deAlloc)(void *))
 append a string to a string list More...
 
int oyjlStringListAdd (char ***list, int *n, void *(*alloc)(size_t), void(*deAlloc)(void *), const char *format,...)
 add a variable string to a string list More...
 
void oyjlStringListDo (char **list, int n, const char *string, void(*listDo)(char **, const char *, void *(*)(size_t), void(*)(void *)), void *(*alloc)(size_t), void(*deAlloc)(void *))
 modify a string list More...
 
int oyjlStringListFind (char **list, int *list_n, const char *pattern, int flags, void(*deAlloc)(void *))
 Find a string in a list. More...
 
int oyjlStringToLong (const char *text, long *value, const char **end)
 
int oyjlStringToDouble (const char *text, double *value, const char **end, int flags)
 text to double conversion More...
 
int oyjlStringsToDoubles (const char *text, const char *delimiter, int *count, void *(*alloc)(size_t), double **value)
 text to double list More...
 
char * oyjlRegExpFind (char *text, const char *regex, int *length)
 search for pattern More...
 
char * oyjlRegExpEscape (const char *text)
 use a pattern literaly More...
 
int oyjlRegExpReplace (char **text, const char *regex, const char *replacement)
 replace pattern More...
 
char * oyjlStringEscape (const char *string, int flags, void *(*alloc)(size_t))
 Convert strings to pass through JSON. More...
 
int oyjlStringStartsWith (const char *text, const char *pattern, int flags)
 simple and fast test More...
 
oyjl_str oyjlStr_New (size_t length, void *(*alloc)(size_t), void(*deAlloc)(void *))
 allocate string object More...
 
oyjl_str oyjlStr_NewFrom (char **text, size_t length, void *(*alloc)(size_t), void(*deAlloc)(void *))
 allocate string object from chars More...
 
void oyjlStr_Release (oyjl_str *string_ptr)
 release a string object More...
 
const char * oyjlStr (oyjl_str string)
 read only the wrapped char array More...
 
char * oyjlStr_Pull (oyjl_str str)
 move the wrapped char array out of the object More...
 
void oyjlStr_Clear (oyjl_str string)
 clear text in a string object More...
 
int oyjlStr_AppendN (oyjl_str string, const char *append, int append_len)
 fast append to the string end More...
 
int oyjlStr_Push (oyjl_str string, const char *text)
 fast append to the string end More...
 
int oyjlStr_Add (oyjl_str string, const char *format,...)
 sprintf for oyjl_str More...
 
int oyjlStr_Replace (oyjl_str text, const char *search, const char *replacement, void(*modifyReplacement)(const char *text, const char *start, const char *end, const char *search, const char **replace, int *replace_len, void *user_data), void *user_data)
 substitute pattern in a string More...
 

Detailed Description

OyjlCore API provides a platformindependent C interface for string helpers.

oyjl - Basic string C API's

Copyright:
2010-2024 (C) Kai-Uwe Behrmann
Author
Kai-Uwe Behrmann ku.b@.nosp@m.gmx..nosp@m.de
License:
MIT http://www.opensource.org/licenses/mit-license.php
Since
2010/09/15