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 #ifndef NOGENTEE
27 #include "collection.h"
28 #endif
29
30 typedef buf str;
31 typedef str * pstr;
32
33 /*-----------------------------------------------------------------------------
34 *
35 * ID: strtrimflags 19.10.06 0.0.A.
36 *
37 * Summary: Flags for str_trim
38 *
39 -----------------------------------------------------------------------------*/
40
41 #define TRIM_ONE 0x0001 // Delete just one character
42 #define TRIM_RIGHT 0x0002 // Trim the right characters
43
44 //--------------------------------------------------------------------------
45
46 #define str_delete buf_delete
47 #define str_ptr( x ) ( x )->data
48 #define str_expand buf_expand
49 #define str_reserve buf_reserve
50 #define str_isequal buf_isequal
51 #define str_index buf_index
52
53 uint STDCALL ptr_wildcardignore( pubyte src, pubyte mask );
54
55 pstr STDCALL str_add( pstr dest, pstr src );
56 pstr STDCALL str_appenduint( pstr pb, uint val );
57 pstr STDCALL str_clear( pstr ps );
58 pstr STDCALL str_copyzero( pstr ps, pubyte src );
59 pstr STDCALL str_copy( pstr dest, pstr src );
60 pstr STDCALL str_copylen( pstr ps, pubyte src, uint len );
61 pstr STDCALL str_dirfile( pstr dir, pstr name, pstr ret );
62 //pstr STDCALL str_expand( pstr ps, uint len );
63 pstr STDCALL str_init( pstr ps );
64 uint STDCALL str_find( pstr ps, uint offset, ubyte symbol, uint fromend );
65 uint STDCALL str_findch( pstr ps, ubyte symbol );
66 uint STDCALL str_len( pstr ps );
67 void STDCALL str_output( pstr ps );
68 pstr DLL_EXPORT CDECLCALL str_printf( pstr ps, pubyte output, ... );
69 //pstr STDCALL str_reserve( pstr ps, uint len );
70 pstr STDCALL str_setlen( pstr ps, uint len );
71 pstr STDCALL str_substr( pstr dest, pstr src, uint off, uint len );
72 pstr STDCALL str_trim( pstr ps, uint symbol, uint flag );
73 void STDCALL str_destroy( pstr ps );
74 pstr STDCALL str_new( pubyte ptr );
75 uint STDCALL str_getdirfile( pstr src, pstr dir, pstr name );
76 uint STDCALL str_isequalign( pstr left, pstr right );
77 uint DLL_EXPORT STDCALL str_pos2line( pstr ps, uint pos, puint lineoff );
78 pstr STDCALL str_out4( pstr ps, pstr format, uint val );
79 pstr STDCALL str_out8( pstr ps, pstr format, ulong64 val );
80 uint STDCALL str_fwildcard( pstr name, pstr mask );
81 #ifndef NOGENTEE
82 pstr STDCALL str_sprintf( pstr ps, pstr output, pcollect pclt );
83 #endif
84
85 //--------------------------------------------------------------------------
86
87 #ifdef __cplusplus
88 }
89 #endif // __cplusplus
90
91 #endif // _STR_
Редактировать