Coin Logo http://www.sim.no/
http://www.coin3d.org/

string.h
00001 #ifndef CC_STRING_H
00002 #define CC_STRING_H
00003 
00004 /**************************************************************************\
00005  *
00006  *  This file is part of the Coin 3D visualization library.
00007  *  Copyright (C) by Kongsberg Oil & Gas Technologies.
00008  *
00009  *  This library is free software; you can redistribute it and/or
00010  *  modify it under the terms of the GNU General Public License
00011  *  ("GPL") version 2 as published by the Free Software Foundation.
00012  *  See the file LICENSE.GPL at the root directory of this source
00013  *  distribution for additional information about the GNU GPL.
00014  *
00015  *  For using Coin with software that can not be combined with the GNU
00016  *  GPL, and for taking advantage of the additional benefits of our
00017  *  support services, please contact Kongsberg Oil & Gas Technologies
00018  *  about acquiring a Coin Professional Edition License.
00019  *
00020  *  See http://www.coin3d.org/ for more information.
00021  *
00022  *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
00023  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
00024  *
00025 \**************************************************************************/
00026 
00027 #include <Inventor/C/basic.h>
00028 
00029 #include <stdarg.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif /* __cplusplus */
00034 
00035 /* ********************************************************************** */
00036 
00037 enum cc_string_constants {
00038   CC_STRING_MIN_SIZE = 128 - sizeof(char *) + sizeof(int)
00039 };
00040 
00041 struct cc_string {
00042   char * pointer;
00043   size_t bufsize;
00044   char buffer[CC_STRING_MIN_SIZE];
00045 };
00046 
00047 typedef  struct cc_string  cc_string;
00048 
00049 typedef char (*cc_apply_f)(char);
00050 
00051 /* ********************************************************************** */
00052 
00053 COIN_DLL_API void cc_string_construct(cc_string * me);
00054 COIN_DLL_API cc_string * cc_string_construct_new(void);
00055 COIN_DLL_API cc_string * cc_string_clone(const cc_string * str);
00056 COIN_DLL_API void cc_string_clean(cc_string * str);
00057 COIN_DLL_API void cc_string_destruct(cc_string * str);
00058 
00059 COIN_DLL_API void cc_string_set_string(cc_string * str, const cc_string * str2);
00060 COIN_DLL_API void cc_string_set_text(cc_string * str, const char * text);
00061 COIN_DLL_API void cc_string_set_subtext(cc_string * str, const char * text, int start, int end);
00062 COIN_DLL_API void cc_string_set_integer(cc_string * str, int integer);
00063 
00064 COIN_DLL_API void cc_string_append_string(cc_string * str, const cc_string * str2);
00065 COIN_DLL_API void cc_string_append_text(cc_string * str, const char * text);
00066 COIN_DLL_API void cc_string_append_integer(cc_string * str, const int digits);
00067 COIN_DLL_API void cc_string_append_char(cc_string * str, const char c);
00068 
00069 COIN_DLL_API unsigned int cc_string_length(const cc_string * str);
00070 COIN_DLL_API int cc_string_is(const cc_string * str);
00071 COIN_DLL_API void cc_string_clear(cc_string * str);
00072 COIN_DLL_API void cc_string_clear_no_free(cc_string * str);
00073 COIN_DLL_API uint32_t cc_string_hash(const cc_string * str);
00074 COIN_DLL_API uint32_t cc_string_hash_text(const char * text);
00075 
00076 COIN_DLL_API const char * cc_string_get_text(const cc_string * str);
00077 COIN_DLL_API void cc_string_remove_substring(cc_string * str, int start, int end);
00078 
00079 COIN_DLL_API int cc_string_compare(const cc_string * lhs, const cc_string * rhs);
00080 COIN_DLL_API int cc_string_compare_text(const char * lhs, const char * rhs);
00081 COIN_DLL_API int cc_string_compare_subtext(const cc_string * str, const char * text, int offset);
00082 
00083 COIN_DLL_API void cc_string_apply(cc_string * str, cc_apply_f function);
00084 
00085 COIN_DLL_API void cc_string_sprintf(cc_string * str, const char * formatstr, ...);
00086 COIN_DLL_API void cc_string_vsprintf(cc_string * str, const char * formatstr, va_list args);
00087 
00088 /* ********************************************************************** */
00089 
00090 #ifdef __cplusplus
00091 } /* extern "C" */
00092 #endif /* __cplusplus */
00093 
00094 #endif /* ! CC_STRING_H */

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Thu Apr 28 2011 03:43:09 for Coin by Doxygen 1.7.4.