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

Oyjl core functions. More...

#include <ctype.h>
#include <math.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include <wchar.h>
#include "oyjl.h"
#include "oyjl_macros.h"
#include "oyjl_version.h"
#include "oyjl_tree_internal.h"

Functions

void oyjlStr_SetCharAt (oyjl_str str, char c, int pos)
 set the char at position More...
 
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 oyjlStringListFind (char **list, int *list_n, const char *pattern, int flags, void(*deAlloc)(void *))
 Find a string in a list. 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...
 
char * oyjlStringCopy (const char *string, void *(*alloc)(size_t))
 duplicate a string with custom allocator More...
 
int oyjlStringAdd (char **string, void *(*alloc)(size_t size), void(*deAlloc)(void *data), const char *format,...)
 sprintf with de-/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...
 
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 oyjlStringListRelease (char ***l, int size, void(*deAlloc)(void *))
 free a 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...
 
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...
 
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...
 
int oyjlRegExpReplace (char **text, const char *regex, const char *replacement)
 replace pattern More...
 
char * oyjlRegExpEscape (const char *text)
 use a pattern literaly 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...
 
int oyjlStringSplitUTF8 (const char *text, char ***mbchars, void *(*alloc)(size_t))
 split letters of a UTF-8 string 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...
 
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...
 
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...
 
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...
 
const char * oyjlTermColorToPlain (const char *text, int flags)
 remove term color marks More...
 

Detailed Description

Oyjl core functions.

oyjl - string helpers

Copyright:
2016-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

Copyright (c) 2004-2023 Kai-Uwe Behrmann ku.b@.nosp@m.gmx..nosp@m.de

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.