• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

  • libtdegames
  • highscore
tdefilelock.h
1 /*
2  This file is part of the TDE games library
3  Copyright (C) 2003 Nicolas Hadacek <hadacek@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library 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 GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #ifndef TDEFILELOCK_H
20 #define TDEFILELOCK_H
21 
22 
23 class KFileLock
24 {
25 public:
26  KFileLock(int fd);
27 
29  ~KFileLock();
30 
32  int fd() const { return _fd; }
33 
34  /*
35  * Lock the file.
36  * @return 0 on success, -1 on failure (no permission) and -2 if another
37  * process is currently locking the file.
38  */
39  int lock();
40 
42  void unlock();
43 
45  bool isLocked() const { return _locked; }
46 
47 private:
48  int _fd;
49  bool _locked;
50 };
51 
52 
53 #endif

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.9.1
This website is maintained by Timothy Pearson.