2 * Copyright 2001-2014, Axel Dörfler, axeld@pinc-software.de.
3 * Copyright 2010, Clemens Zeidler <haiku@clemens-zeidler.de>
4 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
5 * This file may be used under the terms of the MIT License.
7 #ifndef _FILE_SYSTEMS_QUERY_PARSER_UTILS_H
8 #define _FILE_SYSTEMS_QUERY_PARSER_UTILS_H
11 #include <sys/cdefs.h>
16 # include "fssh_api_wrapper.h"
17 # include "fssh_auto_deleter.h"
19 # include <SupportDefs.h>
23 namespace QueryParser
{
30 MATCH_BAD_PATTERN
= -2,
31 MATCH_INVALID_CHARACTER
34 // return values from isValidPattern()
36 PATTERN_INVALID_ESCAPE
= -3,
37 PATTERN_INVALID_RANGE
,
45 void skipWhitespace(char** expr
, int32 skip
= 0);
46 void skipWhitespaceReverse(char** expr
, char* stop
);
47 int compareKeys(uint32 type
, const void* key1
, size_t length1
,
48 const void* key2
, size_t length2
);
49 uint32
utf8ToUnicode(char** string
);
50 int32
getFirstPatternSymbol(char* string
);
51 status_t
isValidPattern(char* pattern
);
52 status_t
matchString(char* pattern
, char* string
);
59 isPattern(char* string
)
61 return getFirstPatternSymbol(string
) >= 0 ? true : false;
65 } // namespace QueryParser
68 #endif // _FILE_SYSTEMS_QUERY_PARSER_UTILS_H