DIRECTORY

Section: SOS CLASS LIBRARY (3S)
Updated: 28/10/91
Index Return to Main Contents
man2html: unable to open or read file /usr/lib/ms/ms.acc
 

NAME

Directory <Entity> - directory facility for SOS objects  

SYNOPSIS

#include "<SOS>/include/dir_sos.h"

class Directory (sos_String name)
   : Mapping<sos_String, Entity> (FALSE, TRUE, FALSE), sos_Named
{
public:
          sos_String             name = name;
   static Directory<sos_Object>  root();
   static sos_Object             lookup (sos_String);
   static void                   set_wd_from_env ();
   static void                   set_wd (sos_String);
   static Directory<sos_Object>  get_wd ();

   // ** Redefinitions **
          void                   insert (sos_String, Entity);
}
 

DESCRIPTION

Directory implements a hierarchical mapping from sos_Strings to sos_Objects together with a lookup method and a process local current working directory. The name of the directory itself (given with the create method) and the sos_Strings that name the entities in the directory (given with the insert method) are automatically copied into the directory container.

Directory::create (cnt, name)
creates a new directory in container cnt with the name name.
Directory::root ()
yields the SOS root directory. This is the only SOS object that can be referenced "directly", that means without a reference from another SOS object. All (persistently) existing SOS objects must ultimately be reachable from the root directory.
Directory::lookup (path)
yields the object that is denoted by the given path which must be a Unix-like full pathname (that means the pathname starts with a '/' and the names of intermediary directory objects are separated by '/'). path is interpreted starting from the SOS root directory; if it denotes no existing SOS object, the result is NO_OBJECT.
Directory::set_wd (p)
sets the current working directory to the directory object denoted by the path p by calling Directory::lookup(p). The system error err_DIR_NO_DIR ("no directory") is raised if Directory::lookup(p) returns no directory object. The current working directory is local to a Unix process.
Directory::set_wd_from_env ()
sets the current working directory to the object denoted by the path given in the Unix environment variable SOSDIR by calling Directory::set_wd (). If SOSDIR is not set or denotes no SOS directory, the system error err_DIR_NO_DIR ("no directory") is raised. The current working directory is local to a Unix process.
Directory::get_wd ()
yields the previously set current working directory. If no working directory has been set, the system error err_DIR_NO_WD ("no working directory") is raised.
insert (name, e)
Enters the entity e into this directory. In contrast to the insert operation of superclass Mapping, name is copied into the container of this directory. As a result, the given name object may be destroyed before this directory is destroyed.
 

FILES

<SOS>/src/dir/dir.sos
SOS schema file

<SOS>/src/dir/dir_sos.h
complete schema interface

<SOS>/src/dir/dir.c
implementation file

<SOS>/lib/sos.a
SOS library
 

SEE_ALSO

Mapping(3), sos_Named(3)  

AUTHOR

Jurgen Uhl


 

Index

NAME
SYNOPSIS
DESCRIPTION
FILES
SEE_ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 00:37:57 GMT, March 30, 2022