SAGA C++ API 1.6
saga::name_space::directory Class Reference

A "Virtual Directory", an RNS entry that is represented as a non-leaf node in the hierarchical name space tree. More...

#include <namespace_dir.hpp>

Inheritance diagram for saga::name_space::directory:

List of all members.

Public Member Functions

 directory (session const &s, saga::url url, int mode=Read, saga::object::type t=saga::object::NSDirectory)
 Creates the object.
 directory (saga::url url, int mode=Read, saga::object::type t=saga::object::NSDirectory)
 Creates the object.
 directory (saga::object const &o)
 Creates the object.
 directory (void)
 Creates the object.
 ~directory (void)
 Destroys the object.
directoryoperator= (saga::object const &o)
 Brief description starts here.
void change_dir (saga::url target)
 Change the working directory.
std::vector< saga::urllist (std::string pattern="*", int flags=saga::name_space::None) const
 List entries in this directory.
std::vector< saga::urlfind (std::string pattern, int flags=saga::name_space::Recursive) const
 Find entries in the current directory and below.
saga::url read_link (saga::url url) const
 Returns the name of the link target.
bool exists (saga::url url) const
 Returns true if entry exists, false otherwise.
bool is_dir (saga::url url) const
 Tests name for being a directory.
bool is_entry (saga::url url) const
 Tests name for being a namespace_entry.
bool is_link (saga::url url) const
 Tests name for beeing a symbolic link.
std::size_t get_num_entries (void) const
 Gives the number of entries in the directory.
saga::url get_entry (std::size_t entry) const
 Gives the name of an entry in the directory based upon the enumeration defined by get_num_entries.
void copy (saga::url source_url, saga::url dest_url, int flags=saga::name_space::None)
 Copy the entry to another part of the namespace.
void copy (std::string source_url, saga::url dest_url, int flags=saga::name_space::None)
 Copy the entry to another part of the namespace.
void copy (char const *source_url, saga::url dest_url, int flags=saga::name_space::None)
 Copy the entry to another part of the namespace.
void link (saga::url source_url, saga::url dest_url, int flags=saga::name_space::None)
 Create a symbolic link from the source entry to the target entry so that any reference to the target refers to the source entry.
void link (std::string source_url, saga::url dest_url, int flags=saga::name_space::None)
 Create a symbolic link from the source entry to the target entry so that any reference to the target refers to the source entry.
void link (char const *source_url, saga::url dest_url, int flags=saga::name_space::None)
 Create a symbolic link from the source entry to the target entry so that any reference to the target refers to the source entry.
void move (saga::url source_url, saga::url dest_url, int flags=saga::name_space::None)
 Rename source to target, or move source to target if target is an directory.
void move (std::string source_url, saga::url dest_url, int flags=saga::name_space::None)
 Rename source to target, or move source to target if target is an directory.
void move (char const *source_url, saga::url dest_url, int flags=saga::name_space::None)
 Rename source to target, or move source to target if target is an directory.
void remove (saga::url url, int flags=saga::name_space::None)
 Removes the entry.
void remove (std::string url, int flags=saga::name_space::None)
 Removes the entry.
void remove (char const *url, int flags=saga::name_space::None)
 Removes the entry.
void make_dir (saga::url url, int flags=saga::name_space::None)
 Creates a new directory.
saga::name_space::entry open (saga::url url, int flags=saga::name_space::Read)
 Creates a new namespace_entry instance.
saga::name_space::directory open_dir (saga::url url, int flags=saga::name_space::Read)
 Creates a new namespace_directory instance.
void permissions_allow (saga::url target, std::string id, int perm, int flags=None)
 Enable a permission.
void permissions_deny (saga::url target, std::string id, int perm, int flags=None)
 Disable a permission.
void permissions_allow (std::string target, std::string id, int perm, int flags=None)
 Enable a permission.
void permissions_deny (std::string target, std::string id, int perm, int flags=None)
 Disable a permission.
void permissions_allow (char const *target, std::string id, int perm, int flags=None)
 Enable a permission.
void permissions_deny (char const *target, std::string id, int perm, int flags=None)
 Disable a permission.

Static Public Member Functions

static directory create (session const &s, saga::url url, int mode=Read)
 Factory function resembling entry(session, url, int) constructor.
static directory create (saga::url url, int mode=Read)
 Factory function resembling entry(url, int) constructor.
template<typename Tag >
static saga::task create (saga::url url, int mode=Read)
 Factory function resembling entry(url, int) constructor.

Detailed Description

A "Virtual Directory", an RNS entry that is represented as a non-leaf node in the hierarchical name space tree.

Inherits all navigation and manipulation methods from ns_entry, but adds some more methods to these sets: instead of dir.copy (target) they allow, for example, to do dir.copy (source, target). Other methods added allow to change the cwd of the instance (which changes the values re- turned by the get_name(), get_cwd() and get_url() inspection methods), and others allow to open new ns_entry and ns_directory instances (open() and open_dir()).

Definition at line 61 of file namespace_dir.hpp.


Constructor & Destructor Documentation

saga::name_space::directory::directory ( session const &  s,
saga::url  url,
int  mode = Read,
saga::object::type  t = saga::object::NSDirectory 
)

Creates the object.

Definition at line 38 of file namespace_dir.cpp.

References saga::object::NSDirectory.

saga::name_space::directory::directory ( saga::url  url,
int  mode = Read,
saga::object::type  t = saga::object::NSDirectory 
) [explicit]

Creates the object.

Definition at line 48 of file namespace_dir.cpp.

References saga::object::NSDirectory.

saga::name_space::directory::directory ( saga::object const &  o) [explicit]

Creates the object.

Reimplemented in saga::advert::directory, and saga::filesystem::directory.

Definition at line 59 of file namespace_dir.cpp.

saga::name_space::directory::directory ( void  )

Creates the object.

Reimplemented in saga::advert::directory, and saga::filesystem::directory.

Definition at line 64 of file namespace_dir.cpp.

saga::name_space::directory::~directory ( void  )

Destroys the object.

Reimplemented in saga::advert::directory, and saga::filesystem::directory.

Definition at line 68 of file namespace_dir.cpp.


Member Function Documentation

static directory saga::name_space::directory::create ( session const &  s,
saga::url  url,
int  mode = Read 
) [inline, static]

Factory function resembling entry(session, url, int) constructor.

Reimplemented from saga::name_space::entry.

Reimplemented in saga::filesystem::directory, and saga::replica::logical_directory.

Definition at line 160 of file namespace_dir.hpp.

static directory saga::name_space::directory::create ( saga::url  url,
int  mode = Read 
) [inline, static]

Factory function resembling entry(url, int) constructor.

Reimplemented from saga::name_space::entry.

Reimplemented in saga::filesystem::directory, saga::filesystem::directory, saga::replica::logical_directory, and saga::replica::logical_directory.

Definition at line 168 of file namespace_dir.hpp.

template<typename Tag >
static saga::task saga::name_space::directory::create ( saga::url  url,
int  mode = Read 
) [inline, static]

Factory function resembling entry(url, int) constructor.

Reimplemented from saga::name_space::entry.

Reimplemented in saga::filesystem::directory, saga::filesystem::directory, saga::replica::logical_directory, and saga::replica::logical_directory.

Definition at line 173 of file namespace_dir.hpp.

directory & saga::name_space::directory::operator= ( saga::object const &  o)

Brief description starts here.

Reimplemented from saga::name_space::entry.

Reimplemented in saga::advert::directory, saga::filesystem::directory, and saga::replica::logical_directory.

Definition at line 72 of file namespace_dir.cpp.

void saga::name_space::directory::change_dir ( saga::url  target) [inline]

Change the working directory.

Parameters:
targetDirectory to change to

Definition at line 190 of file namespace_dir.hpp.

References saga::task::get_result().

std::vector<saga::url> saga::name_space::directory::list ( std::string  pattern = "*",
int  flags = saga::name_space::None 
) const [inline]

List entries in this directory.

Parameters:
patternName or pattern to list
Returns:
Array of names matching the pattern

Definition at line 206 of file namespace_dir.hpp.

References saga::task::get_result().

std::vector<saga::url> saga::name_space::directory::find ( std::string  pattern,
int  flags = saga::name_space::Recursive 
) const [inline]

Find entries in the current directory and below.

Parameters:
patternPattern for names of entries to be found
flagsFlags defining the operation modus
Returns:
Array of names matching the pattern

Definition at line 225 of file namespace_dir.hpp.

References saga::task::get_result().

saga::url saga::name_space::directory::read_link ( saga::url  url) const [inline]

Returns the name of the link target.

Parameters:
urlName to be resolved
Returns:
Resolved name

Definition at line 242 of file namespace_dir.hpp.

References saga::task::get_result().

bool saga::name_space::directory::exists ( saga::url  url) const [inline]

Returns true if entry exists, false otherwise.

Parameters:
urlName to be tested for existence
Returns:
Boolean indicating existence of name

Definition at line 258 of file namespace_dir.hpp.

References saga::task::get_result().

bool saga::name_space::directory::is_dir ( saga::url  url) const [inline]

Tests name for being a directory.

Parameters:
urlName to be tested
Returns:
boolean indicating if name is a directory

Definition at line 274 of file namespace_dir.hpp.

References saga::task::get_result().

bool saga::name_space::directory::is_entry ( saga::url  url) const [inline]

Tests name for being a namespace_entry.

Parameters:
urlName to be tested
Returns:
Boolean indicating if name is a non-directory entry

Definition at line 290 of file namespace_dir.hpp.

References saga::task::get_result().

bool saga::name_space::directory::is_link ( saga::url  url) const [inline]

Tests name for beeing a symbolic link.

Parameters:
urlName to be tested
Returns:
Boolean indicating if name is a link

Definition at line 307 of file namespace_dir.hpp.

References saga::task::get_result().

std::size_t saga::name_space::directory::get_num_entries ( void  ) const [inline]

Gives the number of entries in the directory.

Returns:
Number of entries in the directory

Definition at line 328 of file namespace_dir.hpp.

References saga::task::get_result().

saga::url saga::name_space::directory::get_entry ( std::size_t  entry) const [inline]

Gives the name of an entry in the directory based upon the enumeration defined by get_num_entries.

Parameters:
entryIndex of entry to get
Returns:
Name of entry at index

Definition at line 345 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::copy ( saga::url  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Copy the entry to another part of the namespace.

Parameters:
source_urlName to copy
dest_urlName to copy to
flagsFlags defining the operation modus

Definition at line 361 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::copy ( std::string  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Copy the entry to another part of the namespace.

Parameters:
source_urlName to copy, can contain wild cards
dest_urlName to copy to
flagsFlags defining the operation modus

Definition at line 380 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::copy ( char const *  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Copy the entry to another part of the namespace.

Parameters:
source_urlName to copy, can contain wild cards
dest_urlName to copy to
flagsFlags defining the operation modus

Definition at line 399 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::link ( saga::url  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Create a symbolic link from the source entry to the target entry so that any reference to the target refers to the source entry.

Parameters:
source_urlName to link
dest_urlName to link to
flagsFlags defining the operation modus

Definition at line 424 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::link ( std::string  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Create a symbolic link from the source entry to the target entry so that any reference to the target refers to the source entry.

Parameters:
source_urlName to link, can contain wild cards
dest_urlName to link to
flagsFlags defining the operation modus

Definition at line 445 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::link ( char const *  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Create a symbolic link from the source entry to the target entry so that any reference to the target refers to the source entry.

Parameters:
source_urlName to link, can contain wild cards
dest_urlName to link to
flagsFlags defining the operation modus

Definition at line 466 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::move ( saga::url  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Rename source to target, or move source to target if target is an directory.

Parameters:
source_urlName to move
dest_urlName to move to
flagsFlags defining the operation modus

Definition at line 491 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::move ( std::string  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Rename source to target, or move source to target if target is an directory.

Parameters:
source_urlName to move, can contain wild cards
dest_urlName to move to
flagsFlags defining the operation modus

Definition at line 512 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::move ( char const *  source_url,
saga::url  dest_url,
int  flags = saga::name_space::None 
) [inline]

Rename source to target, or move source to target if target is an directory.

Parameters:
source_urlName to move, can contain wild cards
dest_urlName to move to
flagsFlags defining the operation modus

Definition at line 533 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::remove ( saga::url  url,
int  flags = saga::name_space::None 
) [inline]

Removes the entry.

Parameters:
urlEntry to be removed

Definition at line 553 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::remove ( std::string  url,
int  flags = saga::name_space::None 
) [inline]

Removes the entry.

Parameters:
urlEntry to be removed, can contain wild cards

Definition at line 567 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::remove ( char const *  url,
int  flags = saga::name_space::None 
) [inline]

Removes the entry.

Parameters:
urlEntry to be removed, can contain wild cards

Definition at line 581 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::make_dir ( saga::url  url,
int  flags = saga::name_space::None 
) [inline]

Creates a new directory.

Parameters:
urlDirectory to create

Definition at line 606 of file namespace_dir.hpp.

References saga::task::get_result().

saga::name_space::entry saga::name_space::directory::open ( saga::url  url,
int  flags = saga::name_space::Read 
) [inline]

Creates a new namespace_entry instance.

Parameters:
urlEntry
flagsFlags defining the operation modus
Returns:
Opened entry instance

Reimplemented in saga::advert::directory, saga::filesystem::directory, and saga::replica::logical_directory.

Definition at line 624 of file namespace_dir.hpp.

References saga::task::get_result().

saga::name_space::directory saga::name_space::directory::open_dir ( saga::url  url,
int  flags = saga::name_space::Read 
) [inline]

Creates a new namespace_directory instance.

Parameters:
urlDirectory to open
flagsFlags defining the operation
Returns:
Opened directory instance

Reimplemented in saga::advert::directory, saga::filesystem::directory, and saga::replica::logical_directory.

Definition at line 642 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::permissions_allow ( saga::url  target,
std::string  id,
int  perm,
int  flags = None 
) [inline]

Enable a permission.

Parameters:
targetentry to set permissions for
idid to set permission for
permpermission to enable
flagsmode of operation

Definition at line 666 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::permissions_deny ( saga::url  target,
std::string  id,
int  perm,
int  flags = None 
) [inline]

Disable a permission.

Parameters:
targetentry to set permissions for
idid to set permission for
permpermission to disable
flagsmode of operation

Definition at line 687 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::permissions_allow ( std::string  target,
std::string  id,
int  perm,
int  flags = None 
) [inline]

Enable a permission.

Parameters:
targetentry to set permissions for, may contain wild cards
idid to set permission for
permpermission to enable
flagsmode of operation

Definition at line 708 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::permissions_deny ( std::string  target,
std::string  id,
int  perm,
int  flags = None 
) [inline]

Disable a permission.

Parameters:
targetentry to set permissions for, may contain wild cards
idid to set permission for
permpermission to disable
flagsmode of operation

Definition at line 729 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::permissions_allow ( char const *  target,
std::string  id,
int  perm,
int  flags = None 
) [inline]

Enable a permission.

Parameters:
targetentry to set permissions for, may contain wild cards
idid to set permission for
permpermission to enable
flagsmode of operation

Definition at line 750 of file namespace_dir.hpp.

References saga::task::get_result().

void saga::name_space::directory::permissions_deny ( char const *  target,
std::string  id,
int  perm,
int  flags = None 
) [inline]

Disable a permission.

Parameters:
targetentry to set permissions for, may contain wild cards
idid to set permission for
permpermission to disable
flagsmode of operation

Definition at line 777 of file namespace_dir.hpp.

References saga::task::get_result().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines