| 1 | /* | 
|---|
| 2 | * synergy -- mouse and keyboard sharing utility | 
|---|
| 3 | * Copyright (C) 2002 Chris Schoeneman | 
|---|
| 4 | * | 
|---|
| 5 | * This package is free software; you can redistribute it and/or | 
|---|
| 6 | * modify it under the terms of the GNU General Public License | 
|---|
| 7 | * found in the file COPYING that should have accompanied this file. | 
|---|
| 8 | * | 
|---|
| 9 | * This package is distributed in the hope that it will be useful, | 
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 12 | * GNU General Public License for more details. | 
|---|
| 13 | */ | 
|---|
| 14 |  | 
|---|
| 15 | #ifndef IARCHFILE_H | 
|---|
| 16 | #define IARCHFILE_H | 
|---|
| 17 |  | 
|---|
| 18 | #include "IInterface.h" | 
|---|
| 19 | #include "stdstring.h" | 
|---|
| 20 |  | 
|---|
| 21 | //! Interface for architecture dependent file system operations | 
|---|
| 22 | /*! | 
|---|
| 23 | This interface defines the file system operations required by | 
|---|
| 24 | synergy.  Each architecture must implement this interface. | 
|---|
| 25 | */ | 
|---|
| 26 | class IArchFile : public IInterface { | 
|---|
| 27 | public: | 
|---|
| 28 | //! @name manipulators | 
|---|
| 29 | //@{ | 
|---|
| 30 |  | 
|---|
| 31 | //! Extract base name | 
|---|
| 32 | /*! | 
|---|
| 33 | Find the base name in the given \c pathname. | 
|---|
| 34 | */ | 
|---|
| 35 | virtual const char*     getBasename(const char* pathname) = 0; | 
|---|
| 36 |  | 
|---|
| 37 | //! Get user's home directory | 
|---|
| 38 | /*! | 
|---|
| 39 | Returns the user's home directory.  Returns the empty string if | 
|---|
| 40 | this cannot be determined. | 
|---|
| 41 | */ | 
|---|
| 42 | virtual std::string     getUserDirectory() = 0; | 
|---|
| 43 |  | 
|---|
| 44 | //! Get system directory | 
|---|
| 45 | /*! | 
|---|
| 46 | Returns the ussystem configuration file directory. | 
|---|
| 47 | */ | 
|---|
| 48 | virtual std::string     getSystemDirectory() = 0; | 
|---|
| 49 |  | 
|---|
| 50 | //! Concatenate path components | 
|---|
| 51 | /*! | 
|---|
| 52 | Concatenate pathname components with a directory separator | 
|---|
| 53 | between them.  This should not check if the resulting path | 
|---|
| 54 | is longer than allowed by the system;  we'll rely on the | 
|---|
| 55 | system calls to tell us that. | 
|---|
| 56 | */ | 
|---|
| 57 | virtual std::string     concatPath( | 
|---|
| 58 | const std::string& prefix, | 
|---|
| 59 | const std::string& suffix) = 0; | 
|---|
| 60 |  | 
|---|
| 61 | //@} | 
|---|
| 62 | }; | 
|---|
| 63 |  | 
|---|
| 64 | #endif | 
|---|