libbe_build: Synchronize Directory.cpp with the main one.
The set_dir_fd code appears to be libbe_build specific, so that and accompanying logic is preserved.
This commit is contained in:
@@ -1,15 +1,11 @@
|
|||||||
//----------------------------------------------------------------------
|
/*
|
||||||
// This software is part of the Haiku distribution and is covered
|
* Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
|
||||||
// by the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
//---------------------------------------------------------------------
|
*/
|
||||||
/*!
|
|
||||||
\file Directory.h
|
|
||||||
BDirectory interface declaration.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _DIRECTORY_H
|
#ifndef _DIRECTORY_H
|
||||||
#define _DIRECTORY_H
|
#define _DIRECTORY_H
|
||||||
|
|
||||||
|
|
||||||
#include <Node.h>
|
#include <Node.h>
|
||||||
#include <EntryList.h>
|
#include <EntryList.h>
|
||||||
#include <StorageDefs.h>
|
#include <StorageDefs.h>
|
||||||
@@ -17,90 +13,78 @@
|
|||||||
|
|
||||||
class BFile;
|
class BFile;
|
||||||
class BSymLink;
|
class BSymLink;
|
||||||
|
struct stat_beos;
|
||||||
|
|
||||||
/*!
|
|
||||||
\class BDirectory
|
|
||||||
\brief A directory in the filesystem
|
|
||||||
|
|
||||||
Provides an interface for manipulating directories and their contents.
|
|
||||||
|
|
||||||
\author <a href='mailto:[email protected]'>Ingo Weinhold</a>
|
|
||||||
\author <a href="mailto:[email protected]">Tyler Dauwalder</a>
|
|
||||||
|
|
||||||
\version 0.0.0
|
|
||||||
*/
|
|
||||||
class BDirectory : public BNode, public BEntryList {
|
class BDirectory : public BNode, public BEntryList {
|
||||||
public:
|
public:
|
||||||
BDirectory();
|
BDirectory();
|
||||||
BDirectory(const BDirectory &dir);
|
BDirectory(const BDirectory &dir);
|
||||||
BDirectory(const entry_ref *ref);
|
BDirectory(const entry_ref *ref);
|
||||||
BDirectory(const node_ref *nref);
|
BDirectory(const node_ref *nref);
|
||||||
BDirectory(const BEntry *entry);
|
BDirectory(const BEntry *entry);
|
||||||
BDirectory(const char *path);
|
BDirectory(const char *path);
|
||||||
BDirectory(const BDirectory *dir, const char *path);
|
BDirectory(const BDirectory *dir, const char *path);
|
||||||
|
|
||||||
virtual ~BDirectory();
|
virtual ~BDirectory();
|
||||||
|
|
||||||
status_t SetTo(const entry_ref *ref);
|
status_t SetTo(const entry_ref *ref);
|
||||||
status_t SetTo(const node_ref *nref);
|
status_t SetTo(const node_ref *nref);
|
||||||
status_t SetTo(const BEntry *entry);
|
status_t SetTo(const BEntry *entry);
|
||||||
status_t SetTo(const char *path);
|
status_t SetTo(const char *path);
|
||||||
status_t SetTo(const BDirectory *dir, const char *path);
|
status_t SetTo(const BDirectory *dir, const char *path);
|
||||||
|
|
||||||
status_t GetEntry(BEntry *entry) const;
|
status_t GetEntry(BEntry *entry) const;
|
||||||
|
|
||||||
status_t FindEntry(const char *path, BEntry *entry,
|
bool IsRootDirectory() const;
|
||||||
bool traverse = false) const;
|
|
||||||
|
|
||||||
bool Contains(const char *path, int32 nodeFlags = B_ANY_NODE) const;
|
status_t FindEntry(const char *path, BEntry *entry,
|
||||||
bool Contains(const BEntry *entry, int32 nodeFlags = B_ANY_NODE) const;
|
bool traverse = false) const;
|
||||||
|
|
||||||
status_t GetStatFor(const char *path, struct stat *st) const;
|
bool Contains(const char *path, int32 nodeFlags = B_ANY_NODE) const;
|
||||||
|
bool Contains(const BEntry *entry, int32 nodeFlags = B_ANY_NODE) const;
|
||||||
|
|
||||||
virtual status_t GetNextEntry(BEntry *entry, bool traverse = false);
|
status_t GetStatFor(const char *path, struct stat *st) const;
|
||||||
virtual status_t GetNextRef(entry_ref *ref);
|
|
||||||
virtual int32 GetNextDirents(dirent *buf, size_t bufSize,
|
|
||||||
int32 count = INT_MAX);
|
|
||||||
virtual status_t Rewind();
|
|
||||||
virtual int32 CountEntries();
|
|
||||||
|
|
||||||
status_t CreateDirectory(const char *path, BDirectory *dir);
|
virtual status_t GetNextEntry(BEntry *entry, bool traverse = false);
|
||||||
status_t CreateFile(const char *path, BFile *file,
|
virtual status_t GetNextRef(entry_ref *ref);
|
||||||
bool failIfExists = false);
|
virtual int32 GetNextDirents(dirent *buf, size_t bufSize,
|
||||||
status_t CreateSymLink(const char *path, const char *linkToPath,
|
int32 count = INT_MAX);
|
||||||
BSymLink *link);
|
virtual status_t Rewind();
|
||||||
|
virtual int32 CountEntries();
|
||||||
|
|
||||||
BDirectory &operator=(const BDirectory &dir);
|
status_t CreateDirectory(const char *path, BDirectory *dir);
|
||||||
|
status_t CreateFile(const char *path, BFile *file,
|
||||||
|
bool failIfExists = false);
|
||||||
|
status_t CreateSymLink(const char *path, const char *linkToPath,
|
||||||
|
BSymLink *link);
|
||||||
|
|
||||||
private:
|
BDirectory &operator=(const BDirectory &dir);
|
||||||
friend class BNode;
|
|
||||||
|
|
||||||
virtual void _ErectorDirectory1();
|
private:
|
||||||
virtual void _ErectorDirectory2();
|
friend class BNode;
|
||||||
virtual void _ErectorDirectory3();
|
friend class BEntry;
|
||||||
virtual void _ErectorDirectory4();
|
friend class BFile;
|
||||||
virtual void _ErectorDirectory5();
|
|
||||||
virtual void _ErectorDirectory6();
|
|
||||||
|
|
||||||
private:
|
virtual void _ErectorDirectory1();
|
||||||
virtual void close_fd();
|
virtual void _ErectorDirectory2();
|
||||||
int get_fd() const;
|
virtual void _ErectorDirectory3();
|
||||||
|
virtual void _ErectorDirectory4();
|
||||||
|
virtual void _ErectorDirectory5();
|
||||||
|
virtual void _ErectorDirectory6();
|
||||||
|
|
||||||
status_t set_dir_fd(int fd);
|
private:
|
||||||
|
virtual void close_fd();
|
||||||
|
int get_fd() const;
|
||||||
|
|
||||||
private:
|
status_t set_dir_fd(int fd);
|
||||||
uint32 _reservedData[7];
|
|
||||||
int fDirFd;
|
|
||||||
node_ref fDirNodeRef;
|
|
||||||
|
|
||||||
friend class BEntry;
|
private:
|
||||||
friend class BFile;
|
uint32 _reservedData[7];
|
||||||
|
int fDirFd;
|
||||||
|
node_ref fDirNodeRef;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// C functions
|
|
||||||
|
|
||||||
status_t create_directory(const char *path, mode_t mode);
|
status_t create_directory(const char *path, mode_t mode);
|
||||||
|
|
||||||
|
|
||||||
#endif // _DIRECTORY_H
|
#endif // _DIRECTORY_H
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user