filepath.h
Go to the documentation of this file.
/*
* filepath.h
*
* File system path string abstraction class.
*
* Portable Windows Library
*
* Copyright (c) 1993-1998 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Portions are Copyright (C) 1993 Free Software Foundation, Inc.
* All Rights Reserved.
*
* Contributor(s): ______________________________________.
*
* $Revision: 24177 $
* $Author: rjongbloed $
* $Date: 2010-04-05 06:52:04 -0500 (Mon, 05 Apr 2010) $
*/
#ifndef PTLIB_FILEPATH_H
#define PTLIB_FILEPATH_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#ifdef DOC_PLUS_PLUS
class PFilePathString : public PString { };
#endif
// File Specification
class PFilePath : public PFilePathString
{
PCLASSINFO(PFilePath, PFilePathString);
public:
PFilePath();
PFilePath(
const char * cstr
);
PFilePath(
const PString & str
);
PFilePath(
const PFilePath & path
);
PFilePath(
const char * prefix,
const char * dir
);
PFilePath & operator=(
const PFilePath & path
);
PFilePath & operator=(
const PString & str
);
PFilePath & operator=(
const char * cstr
);
PFilePath & operator+=(
const PString & str
);
PFilePath & operator+=(
const char * cstr
);
PFilePath & operator+=(
char ch // Character to concatenate.
);
PFilePathString GetVolume() const;
PFilePathString GetPath() const;
PFilePathString GetTitle() const;
PFilePathString GetType() const;
PFilePathString GetFileName() const;
PDirectory GetDirectory() const;
void SetType(
const PFilePathString & type
);
static PBoolean IsValid(
char c
);
static PBoolean IsValid(
const PString & str
);
static bool IsAbsolutePath(
const PString & path
);
protected:
virtual void AssignContents(const PContainer & cont);
// Include platform dependent part of class
#ifdef _WIN32
#include "msos/ptlib/filepath.h"
#else
#include "unix/ptlib/filepath.h"
#endif
};
#endif // PTLIB_FILEPATH_H
// End Of File ///////////////////////////////////////////////////////////////
PString::operator=
PString & operator=(const PString &str)
Assign the string to the current object.
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PFilePath
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
PBoolean
BOOL PBoolean
Definition: object.h:102
PDirectory
Class to represent a directory in the operating system file system.
Definition: pdirect.h:182
PString::operator+=
PString & operator+=(const PString &str)
Concatenate a string to another string, modifiying that string.
PContainer::AssignContents
virtual void AssignContents(const PContainer &c)
Copy the container contents.
PString
The character string class.
Definition: pstring.h:108
PFilePathString
Base string type for a file path.
Definition: filepath.h:48
PContainer
Abstract class to embody the base functionality of a container.
Definition: contain.h:104