/*
* Copyright 1995, 1996 Perforce Software. All rights reserved.
*
* This file is part of Perforce - the FAST SCM System.
*/
/*
* PathSys.h - OS specific pathnames
*
* Public classes:
*
* PathSys - a StrBuf with virtual path manipulations
*
* Public methods:
*
* StrBuf::Set() - set value in local syntax
* StrBuf::Text() - get value in local syntax
*
* PathSys::SetRootedCanon() - combine (local) root and canonical path
* PathSys::SetRootedLocal() - combine (local) root and local path
* PathSys::AppendUnrootedCanon() - strip root and return rest as canon
* PathSys::ToParent() - strip (and return) last element of path
*
* Static functions:
*
* Create() - returns an appropriate PathSys, given an OS type flag.
* GetOS() - returns a string for the OS name
*/
class PathSys : public StrBuf {
public:
virtual ~PathSys();
virtual void SetRootedCanon( const StrPtr *root, const char *canon ) = 0;
virtual void SetRootedLocal( const StrPtr *root, const char *local ) = 0;
virtual int AppendUnrootedCanon( const StrPtr *root, StrBuf *t ) = 0;
virtual int ToParent( StrBuf *file = 0 ) = 0;
static PathSys *Create();
static PathSys *Create( int os );
static PathSys *Create( const StrPtr &os, Error *e );
static const char *GetOS();
} ;