PUMA Library Reference Manual
Puma::CProject Class Reference

#include <CProject.h>

+ Inheritance diagram for Puma::CProject:

Public Member Functions

 CProject (ErrorStream &e)
 
 CProject (ErrorStream &, const char *defs, const char *decls=(const char *) 0)
 
 CProject (ErrorStream &, int &argc, char **&argv, const char *defs=(const char *) 0, const char *decls=(const char *) 0)
 
Configconfig ()
 
virtual void configure (Config &)
 
UnitaddFile (Filename file)
 
CScannerscanner ()
 
virtual UnitscanFile (const char *file, Source *=(Source *) 0, bool isFile=true)
 
virtual UnitscanString (const char *str, const char *name=(const char *) 0)
 
Filename getInclString (Filename filename)
 
- Public Member Functions inherited from Puma::Project
 Project (ErrorStream &err)
 Constructor. More...
 
virtual ~Project ()
 Destructor. More...
 
void saveMode (Mode mode=OVERWRITE, const char *suffix=0)
 Set the mode for saving an unit. More...
 
virtual void save (Unit *unit, bool only_modified=false) const
 Save a unit using the name of the unit to get the full name of the file and path to save to. More...
 
virtual void save (const char *file=0, bool only_modified=false, bool is_reg_ex=false) const
 Save one, all or all matching files. More...
 
void print (const char *name=0, std::ostream &out=std::cout, bool is_reg_ex=false) const
 Print one, all or all matching units. More...
 
void close (const char *name=0, bool destroy=false, bool is_reg_ex=false) const
 Close one, all or all matching units. More...
 
UnitaddFile (Filename file)
 Add a new file to the project. More...
 
UnitaddFile (Filename srcFile, Filename destFile)
 Add a new file to the project. More...
 
virtual void configure (const Config &config)
 Configure the project from the command line or a file. More...
 
UnitManagerunitManager ()
 Get the unit manager. More...
 
bool isNewer (const char *file) const
 Check if the given file in the source directory or the unit is newer than the corresponding file in the destination directory. More...
 
virtual bool isBelow (const char *file) const
 Check if a given file is found below any of the source paths of this project. More...
 
virtual bool isBelow (Unit *file) const
 Check if a given file is found below any of the source paths of this project. More...
 
- Public Member Functions inherited from Puma::PathManager
 PathManager (ErrorStream &err)
 Constructor. More...
 
 PathManager (PathManager &other)
 Copy-constructor. More...
 
virtual ~PathManager ()
 Destructor. More...
 
void glob (char *filenamePattern=0)
 Search files in the managed path matching the given filename pattern or every file if no pattern is given. More...
 
bool iterate (PathIterator &iterator) const
 Iterate the contents of the managed paths. More...
 
virtual void addPath (const char *srcPath, const char *destPath=0)
 Add a source and destination paths pair. More...
 
ProjectFile::MapConstIter addFile (Filename filename)
 Add a new file to the project file list. More...
 
ProjectFile::MapConstIter addFile (Filename filename, Filename destPath)
 Add a new file to the project file list. More...
 
void setDest (const char *srcPath, const char *destPath)
 Set the destination path of the given source path. More...
 
void protect (const char *pathPattern)
 Add a pattern for a write-protected path. More...
 
long numPaths () const
 Get the number of managed paths. More...
 
long numProts () const
 Get the number of managed write-protected paths. More...
 
const char * src (long n) const
 Get the n-th managed source path. More...
 
const char * src_canon (long n) const
 Get canonical version of the n-th managed source path. More...
 
const char * dest (long n) const
 Get the n-th managed destination path. More...
 
RegCompprot (long n) const
 Get the n-th managed write-protected path pattern. More...
 
bool isProtected (const char *path) const
 Check if the given path is write-protected. More...
 
bool isBelow (const char *filename, ProjectFile::MapConstIter &iterator) const
 Check if a given file is directly managed by this path manager or is found below any of the managed paths. More...
 
virtual void join (PathManager &other)
 Join the paths of the given manager with the paths of this path manager. More...
 
ErrorStreamerr () const
 Get the error stream used by this path manager. More...
 
bool getDestinationPath (const char *sourcePath, std::ostream &out) const
 Get the destination path of a given source path and write it on the given output stream. More...
 

Additional Inherited Members

- Public Types inherited from Puma::SaveMode
enum  Mode {
  OVERWRITE = 1,
  RENAME_OLD,
  NEW_SUFFIX
}
 Save modes. More...
 
- Protected Member Functions inherited from Puma::Project
virtual void write (Unit *unit, std::ofstream &file) const
 Write a unit on the given file output stream. More...
 
- Protected Member Functions inherited from Puma::PathManager
const char * getDestination (Filename sourcePath, std::ostream *destinationPath=0) const
 Get the destination path for a given source path. More...
 
virtual void action (PathIterator &iterator)
 Called for every matched file when traversing a source path. More...
 
char * addSeparator (const char *path) const
 Add the separator '/' to the end of the given path. More...
 
char * addSeparator (const char *path, char *buffer) const
 Add the separator '/' to the end of the given path and store the resulting path in the given buffer. More...
 

Constructor & Destructor Documentation

◆ CProject() [1/3]

Puma::CProject::CProject ( ErrorStream e)

◆ CProject() [2/3]

Puma::CProject::CProject ( ErrorStream ,
const char *  defs,
const char *  decls = (const char *) 0 
)

◆ CProject() [3/3]

Puma::CProject::CProject ( ErrorStream ,
int &  argc,
char **&  argv,
const char *  defs = (const char *) 0,
const char *  decls = (const char *) 0 
)

Member Function Documentation

◆ addFile()

Unit* Puma::CProject::addFile ( Filename  file)

◆ config()

Config & Puma::CProject::config ( )
inline

◆ configure()

virtual void Puma::CProject::configure ( Config )
virtual

◆ getInclString()

Filename Puma::CProject::getInclString ( Filename  filename)

◆ scanFile()

virtual Unit* Puma::CProject::scanFile ( const char *  file,
Source = (Source *) 0,
bool  isFile = true 
)
virtual

◆ scanner()

CScanner & Puma::CProject::scanner ( )
inline

◆ scanString()

virtual Unit* Puma::CProject::scanString ( const char *  str,
const char *  name = (const char *) 0 
)
virtual