Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/util/directory.h @ 7783

Last change on this file since 7783 was 7661, checked in by bensch, 18 years ago

orxonox/trunk: merged the QT_GUI back to the trunk
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/qt_gui . -r7607:HEAD

absolutely no conflicts :)

File size: 2.8 KB
Line 
1/*!
2 * @file directory.h
3 * @brief Definition of the Directory Handler class
4 */
5
6
7/**
8 * Copyright (C) 2002 Bart Vanhauwaert
9 *
10 * Permission to use, copy, modify, distribute and sell this software
11 * for any purpose is hereby granted without fee. This license
12 * includes (but is not limited to) standalone compilation or as part
13 * of a larger project.
14 *
15 * This software is provided "as is" without express or implied warranty.
16 *
17 * For a full statement on warranty and terms and conditions for
18 * copying, distribution and modification, please see the comment block
19 * at the end of this file.
20 *
21 * Version 1
22 *
23 */
24
25#ifndef __DIRECTORY_H_
26#define __DIRECTORY_H_
27
28#include "file.h"
29
30#if not defined (__WIN32__)
31 #include <sys/types.h>
32 #include <dirent.h>
33#else
34 #include <windows.h>
35 #include <winbase.h>
36#endif
37
38class Directory : public File
39{
40public:
41  Directory(const std::string& directoryName = "");
42  ~Directory();
43
44  virtual bool open();
45  virtual bool close();
46  operator void*() const { return willfail ? (void*)0:(void*)(-1); }
47
48  std::string next();
49
50  bool create();
51
52private:
53#if not defined(__WIN32__)
54  DIR* handle;
55#else
56  HANDLE    handle;
57#endif
58  bool willfail;
59  std::string current;
60};
61
62#endif /* __DIRECTORY_H_ */
63
64/**
65 *
66 * The "library", above, refers to the collection of software functions
67 * and/or data contained in this file, prepared so as to be conveniently
68 * compiled and linked with application programs (which use some of those
69 * functions and data) to form executables.
70 *
71 *                             NO WARRANTY
72 *
73 * 1. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
74 * WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
75 * EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
76 * OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
77 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
78 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
79 * PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
80 * LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
81 * THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
82 *
83 * 2. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
84 * WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
85 * AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
86 * FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
87 * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
88 * LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
89 * RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
90 * FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
91 * SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
92 * DAMAGES.
93 *
94 * END OF TERMS AND CONDITIONS
95 *
96 */
97
Note: See TracBrowser for help on using the repository browser.