xref: /haiku/headers/private/storage/storage_support.h (revision 1c4b41005c3fb8f00c72c30229749b50308631fd)
152a38012Sejakowatz //----------------------------------------------------------------------
252a38012Sejakowatz //  This software is part of the OpenBeOS distribution and is covered
352a38012Sejakowatz //  by the OpenBeOS license.
452a38012Sejakowatz //---------------------------------------------------------------------
552a38012Sejakowatz /*!
652a38012Sejakowatz 	\file storage_support.h
752a38012Sejakowatz 	Interface declarations for miscellaneous internal
852a38012Sejakowatz 	Storage Kit support functions.
952a38012Sejakowatz */
1052a38012Sejakowatz 
1182b75665STyler Dauwalder #ifndef _STORAGE_SUPPORT_H
1282b75665STyler Dauwalder #define _STORAGE_SUPPORT_H
1352a38012Sejakowatz 
14*1c4b4100STyler Dauwalder #include <string>
1552a38012Sejakowatz 
1609d84e61STyler Dauwalder namespace BPrivate {
1709d84e61STyler Dauwalder namespace Storage {
1852a38012Sejakowatz 
1952a38012Sejakowatz //! Returns whether the supplied path is absolute.
2052a38012Sejakowatz bool is_absolute_path(const char *path);
2152a38012Sejakowatz 
2252a38012Sejakowatz //!	splits a path name into directory path and leaf name
2352a38012Sejakowatz status_t split_path(const char *fullPath, char *&path, char *&leaf);
2452a38012Sejakowatz 
2552a38012Sejakowatz //!	splits a path name into directory path and leaf name
2652a38012Sejakowatz status_t split_path(const char *fullPath, char **path, char **leaf);
2752a38012Sejakowatz 
2852a38012Sejakowatz //! Parses the first component of a path name.
2952a38012Sejakowatz status_t parse_first_path_component(const char *path, int32& length,
3052a38012Sejakowatz 									int32& nextComponent);
3152a38012Sejakowatz 
3252a38012Sejakowatz //! Parses the first component of a path name.
3352a38012Sejakowatz status_t parse_first_path_component(const char *path, char *&component,
3452a38012Sejakowatz 									int32& nextComponent);
3552a38012Sejakowatz 
3652a38012Sejakowatz //! Checks whether an entry name is a valid entry name.
3752a38012Sejakowatz status_t check_entry_name(const char *entry);
3852a38012Sejakowatz 
3952a38012Sejakowatz //! Checks whether a path name is a valid path name.
4052a38012Sejakowatz status_t check_path_name(const char *path);
4152a38012Sejakowatz 
42*1c4b4100STyler Dauwalder //! Returns a copy of \c str in which all alphabetic characters are lowercase.
43*1c4b4100STyler Dauwalder std::string to_lower(const char *str);
44*1c4b4100STyler Dauwalder 
45*1c4b4100STyler Dauwalder //! Places a copy of \c str in \c result in which all alphabetic characters are lowercase.
46*1c4b4100STyler Dauwalder void to_lower(const char *str, std::string &result);
47*1c4b4100STyler Dauwalder 
48*1c4b4100STyler Dauwalder //! Copies \c str into \c result, converting any uppercase alphabetics to lowercase.
49*1c4b4100STyler Dauwalder void to_lower(const char *str, char *result);
50*1c4b4100STyler Dauwalder 
51*1c4b4100STyler Dauwalder //! Converts \c str to lowercase.
52*1c4b4100STyler Dauwalder void to_lower(char *str);
53*1c4b4100STyler Dauwalder 
5409d84e61STyler Dauwalder };	// namespace Storage
5509d84e61STyler Dauwalder };	// namespace BPrivate
5652a38012Sejakowatz 
5782b75665STyler Dauwalder #endif	// _STORAGE_SUPPORT_H
5809d84e61STyler Dauwalder 
5909d84e61STyler Dauwalder 
60