xref: /haiku/headers/private/storage/storage_support.h (revision 1c4b41005c3fb8f00c72c30229749b50308631fd)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //---------------------------------------------------------------------
5 /*!
6 	\file storage_support.h
7 	Interface declarations for miscellaneous internal
8 	Storage Kit support functions.
9 */
10 
11 #ifndef _STORAGE_SUPPORT_H
12 #define _STORAGE_SUPPORT_H
13 
14 #include <string>
15 
16 namespace BPrivate {
17 namespace Storage {
18 
19 //! Returns whether the supplied path is absolute.
20 bool is_absolute_path(const char *path);
21 
22 //!	splits a path name into directory path and leaf name
23 status_t split_path(const char *fullPath, char *&path, char *&leaf);
24 
25 //!	splits a path name into directory path and leaf name
26 status_t split_path(const char *fullPath, char **path, char **leaf);
27 
28 //! Parses the first component of a path name.
29 status_t parse_first_path_component(const char *path, int32& length,
30 									int32& nextComponent);
31 
32 //! Parses the first component of a path name.
33 status_t parse_first_path_component(const char *path, char *&component,
34 									int32& nextComponent);
35 
36 //! Checks whether an entry name is a valid entry name.
37 status_t check_entry_name(const char *entry);
38 
39 //! Checks whether a path name is a valid path name.
40 status_t check_path_name(const char *path);
41 
42 //! Returns a copy of \c str in which all alphabetic characters are lowercase.
43 std::string to_lower(const char *str);
44 
45 //! Places a copy of \c str in \c result in which all alphabetic characters are lowercase.
46 void to_lower(const char *str, std::string &result);
47 
48 //! Copies \c str into \c result, converting any uppercase alphabetics to lowercase.
49 void to_lower(const char *str, char *result);
50 
51 //! Converts \c str to lowercase.
52 void to_lower(char *str);
53 
54 };	// namespace Storage
55 };	// namespace BPrivate
56 
57 #endif	// _STORAGE_SUPPORT_H
58 
59 
60