* Added find directory constants B_{BEOS|COMMON|USER}_DATA_DIRECTORY, which
currently points to /etc for the system, and dedicated "data" directories for common/user (the system directory should get a dedicated "data", too, though). * Added B_USER_CACHE_DIRECTORY (in config/cache). * These additions were discussed some years ago, but I just had a good reason to use them :-) * Coding style cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26990 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,39 +1,20 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file FindDirectory.h
|
||||
Declarations of find_directory() functions and associated types.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2002-2008, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _FIND_DIRECTORY_H
|
||||
#define _FIND_DIRECTORY_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
/* ---
|
||||
Per volume directories. When asking for these
|
||||
directories, a volume must be specified, or the call will assume
|
||||
the boot volume.
|
||||
--- */
|
||||
|
||||
// Per volume directories
|
||||
B_DESKTOP_DIRECTORY = 0,
|
||||
B_TRASH_DIRECTORY,
|
||||
|
||||
/* ---
|
||||
BeOS directories. These are mostly accessed read-only.
|
||||
--- */
|
||||
|
||||
// System directories
|
||||
B_BEOS_DIRECTORY = 1000,
|
||||
B_BEOS_SYSTEM_DIRECTORY,
|
||||
B_BEOS_ADDONS_DIRECTORY,
|
||||
@@ -49,11 +30,9 @@ typedef enum {
|
||||
B_BEOS_TRANSLATORS_DIRECTORY,
|
||||
B_BEOS_MEDIA_NODES_DIRECTORY,
|
||||
B_BEOS_SOUNDS_DIRECTORY,
|
||||
B_BEOS_DATA_DIRECTORY,
|
||||
|
||||
/* ---
|
||||
Common directories, shared among all users.
|
||||
--- */
|
||||
|
||||
// Common directories, shared among all users.
|
||||
B_COMMON_DIRECTORY = 2000,
|
||||
B_COMMON_SYSTEM_DIRECTORY,
|
||||
B_COMMON_ADDONS_DIRECTORY,
|
||||
@@ -73,13 +52,11 @@ typedef enum {
|
||||
B_COMMON_TRANSLATORS_DIRECTORY,
|
||||
B_COMMON_MEDIA_NODES_DIRECTORY,
|
||||
B_COMMON_SOUNDS_DIRECTORY,
|
||||
B_COMMON_DATA_DIRECTORY,
|
||||
|
||||
|
||||
/* ---
|
||||
User directories. These are interpreted in the context
|
||||
of the user making the find_directory call.
|
||||
--- */
|
||||
|
||||
// User directories. These are interpreted in the context
|
||||
// of the user making the find_directory call.
|
||||
B_USER_DIRECTORY = 3000,
|
||||
B_USER_CONFIG_DIRECTORY,
|
||||
B_USER_ADDONS_DIRECTORY,
|
||||
@@ -92,46 +69,36 @@ typedef enum {
|
||||
B_USER_TRANSLATORS_DIRECTORY,
|
||||
B_USER_MEDIA_NODES_DIRECTORY,
|
||||
B_USER_SOUNDS_DIRECTORY,
|
||||
B_USER_DATA_DIRECTORY,
|
||||
B_USER_CACHE_DIRECTORY,
|
||||
|
||||
/* ---
|
||||
Global directories.
|
||||
--- */
|
||||
|
||||
// Global directories.
|
||||
B_APPS_DIRECTORY = 4000,
|
||||
B_PREFERENCES_DIRECTORY,
|
||||
B_UTILITIES_DIRECTORY
|
||||
|
||||
} directory_which;
|
||||
|
||||
/* ---
|
||||
The C interface
|
||||
--- */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// C interface
|
||||
|
||||
status_t find_directory(directory_which which, dev_t volume, bool createIt,
|
||||
char *pathString, int32 length);
|
||||
char* pathString, int32 length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
// C++ interface
|
||||
|
||||
class BVolume;
|
||||
class BPath;
|
||||
|
||||
/* ---
|
||||
C++ interface
|
||||
--- */
|
||||
status_t find_directory(directory_which which, BPath* path,
|
||||
bool createIt = false, BVolume* volume = NULL);
|
||||
|
||||
status_t find_directory(directory_which which, BPath *path,
|
||||
bool createIt = false, BVolume *volume = NULL);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}; // namespace OpenBeOS
|
||||
#endif
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // _FIND_DIRECTORY_H
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user