1 /******************************************************************************
2 *
3 * Copyright (C) 2006, The Gentee Group. All rights reserved.
4 * This file is part of the Gentee open source project - http://www.gentee.com.
5 *
6 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE GENTEE LICENSE ("AGREEMENT").
7 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS
8 * ACCEPTANCE OF THE AGREEMENT.
9 *
10 * ID: str 18.10.06 0.0.A.
11 *
12 * Author: Alexey Krivonogov
13 *
14 * Summary: This file provides functionality for 'str' type.
15 *
16 ******************************************************************************/
17
18 #ifndef _STR_
19 #define _STR_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif // __cplusplus
24
25 #include "buf.h"
26 #include "collection.h"
27
28 typedef buf str;
29 typedef str * pstr;
30
31 /*-----------------------------------------------------------------------------
32 *
33 * ID: strtrimflags 19.10.06 0.0.A.
34 *
35 * Summary: Flags for str_trim
36 *
37 -----------------------------------------------------------------------------*/
38
39 #define TRIM_ONE 0x0001 // Delete just one character
40 #define TRIM_RIGHT 0x0002 // Trim the right characters
41
42 //--------------------------------------------------------------------------
43
44 #define str_delete buf_delete
45 #define str_ptr( x ) ( x )->data
46 #define str_expand buf_expand
47 #define str_reserve buf_reserve
48 #define str_isequal buf_isequal
49 #define str_index buf_index
50
51 uint STDCALL ptr_wildcardignore( pubyte src, pubyte mask );
52
53 pstr STDCALL str_add( pstr dest, pstr src );
54 pstr STDCALL str_appenduint( pstr pb, uint val );
55 pstr STDCALL str_clear( pstr ps );
56 pstr STDCALL str_copyzero( pstr ps, pubyte src );
57 pstr STDCALL str_copy( pstr dest, pstr src );
58 pstr STDCALL str_copylen( pstr ps, pubyte src, uint len );
59 pstr STDCALL str_dirfile( pstr dir, pstr name, pstr ret );
60 //pstr STDCALL str_expand( pstr ps, uint len );
61 pstr STDCALL str_init( pstr ps );
62 uint STDCALL str_find( pstr ps, uint offset, ubyte symbol, uint fromend );
63 uint STDCALL str_findch( pstr ps, ubyte symbol );
64 uint STDCALL str_len( pstr ps );
65 void STDCALL str_output( pstr ps );
66 pstr DLL_EXPORT CDECLCALL str_printf( pstr ps, pubyte output, ... );
67 //pstr STDCALL str_reserve( pstr ps, uint len );
68 pstr STDCALL str_setlen( pstr ps, uint len );
69 pstr STDCALL str_substr( pstr dest, pstr src, uint off, uint len );
70 pstr STDCALL str_trim( pstr ps, uint symbol, uint flag );
71 void STDCALL str_destroy( pstr ps );
72 pstr STDCALL str_new( pubyte ptr );
73 uint STDCALL str_getdirfile( pstr src, pstr dir, pstr name );
74 uint STDCALL str_isequalign( pstr left, pstr right );
75 uint DLL_EXPORT STDCALL str_pos2line( pstr ps, uint pos, puint lineoff );
76 pstr STDCALL str_out4( pstr ps, pstr format, uint val );
77 pstr STDCALL str_out8( pstr ps, pstr format, ulong64 val );
78 uint STDCALL str_fwildcard( pstr name, pstr mask );
79 pstr STDCALL str_sprintf( pstr ps, pstr output, pcollect pclt );
80
81 //--------------------------------------------------------------------------
82
83 #ifdef __cplusplus
84 }
85 #endif // __cplusplus
86
87 #endif // _STR_
Edit