Commit Graph

61 Commits

Author SHA1 Message Date
Alyssa Milburn
7840b5e4b9 COMMON: Add depth/flat parameters to addSubDirectoryMatching. 2013-06-06 21:41:14 +02:00
Andrea Corna
a6ec4f70da COMMON: Make more members of Archive constant. 2011-12-13 17:55:57 +01:00
Christoph Mallon
84220d2ca0 COMMON: Remove superfluous Common:: qualifiers. 2011-08-07 15:19:07 +02:00
Christoph Mallon
23a0f5318c JANITORIAL: Remove trailing empty lines. 2011-08-07 13:53:33 +02:00
Ori Avtalion
aa0f307e06 ALL: Require DECLARE_SINGLETON to be used in the Common namepsace
Silences the clang warning:

  static data member specialization of '_singleton' must
  originally be declared in namespace 'Common'; accepted as a C++0x
  extension [-Wc++0x-extensions]

Wrapping "namespace Common {}" around the macro assignment causes clang
to complain about a spurious semicolon, and removing the semicolon at
the end of the macro causes some editors to misbehave.

Changing the requirement of using the macro in one namespace (the
global) to another (Common) seems a small price to pay to
silence a warning.
2011-06-30 22:41:41 +03:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Max Horn
abe1959d36 COMMON: Simplify DECLARE_SINGLETON macro
This makes it possible to write
  DECLARE_SINGLETON(foo);
instead of
  DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.

svn-id: r54258
2010-11-16 08:23:13 +00:00
Johannes Schickel
40562798d6 Fix our DECLARE_SINGLETON macro to conform to the C++ specs.
We need to use a namespace Common { } there to make strict C++ compilers
like clang++ and comeau happy. I also added a slight comment about why
that is needed to the macro definition and a note that you need to use
it from the global namespace.

svn-id: r48254
2010-03-13 21:55:49 +00:00
Johannes Schickel
1ba750063c Ooops...
svn-id: r46048
2009-11-21 20:26:55 +00:00
Johannes Schickel
e8c67bda4b Change Archive::listMatchingMembers to match the pattern case-insensitively.
svn-id: r46046
2009-11-21 20:19:15 +00:00
Yotam Barnoy
1336b5464b Fixed bug in archive.cpp that caused at least one engine (SAGA) not to work
svn-id: r44560
2009-10-03 20:12:44 +00:00
Johannes Schickel
c50940bbf4 Got rid of Common::File::addDefaultDirectory, instead implemented the solution proposed in "Case agnostic handling for directories (and files)" on -devel.
svn-id: r44266
2009-09-23 00:15:00 +00:00
Johannes Schickel
75113ad5f3 COMMON: Add "ignoreCase" parameter to matchString.
svn-id: r44265
2009-09-23 00:14:06 +00:00
Willem Jan Palenstijn
6e38259270 Add a 'flat' option to FSDirectory to allow searching recursively for files in subdirectories
svn-id: r41090
2009-06-01 00:01:32 +00:00
Max Horn
5181546c63 Rewrote Common::List iterator code to ensure const correctness is preserved.
We tried to implement the list iterators in a clever way, to reduce code
duplication. But this is essentially impossible to do properly, sadly --
this is one of the places where the ugly drawbacks of C++ really show.
As a consequence, our implementation had a bug which allowed one to
convert any const_iterator to an iterator, thus allowing modifying
elements of const lists.

This rewrite reintroduces code duplication but at least ensures that no
const list is written to accidentally.

Also fix some places which incorrectly used iterator instead of const_iterator
or (in the kyra code) accidentally wrote into a const list.

svn-id: r39279
2009-03-09 22:26:02 +00:00
Max Horn
d7b3c04588 Moved FSDirectory implementation from common/archive.cpp to common/fs.cpp
svn-id: r38824
2009-02-24 03:22:34 +00:00
Max Horn
9b45dd2849 Modified FSDirectory::lookupCache to return a FSNode *pointer*, so that we can distinguish between lookup failures and invalid cache entries. Also changed SearchSet::createReadStreamForMember to not use hasFile anymore, based on the assumption that any Archive::createReadStreamForMember implementation has to verify whether the member name is valid anyway (clarified the doxygen docs accordingly)
svn-id: r38787
2009-02-22 16:48:02 +00:00
Max Horn
f6de07921e Changed Common::File and FSDirectory to invoke FSNode::exists a few times less, reducing overhead
svn-id: r38780
2009-02-22 04:40:10 +00:00
Max Horn
17014c4f47 Merged internal 'matchPath' method of class Archive into global matchString function (via an optional 'path mode' in the latter). Also changed Archive::listMatchingMembers to use path mode when matching, just like FSDirectory::listMatchingMembers
svn-id: r38277
2009-02-15 18:45:53 +00:00
Max Horn
7eaafd933f Be paranoid about g_system being set
svn-id: r36131
2009-01-29 22:09:06 +00:00
Max Horn
14c5bbbccf Renamed Archive::openFile to createReadStreamForMember
svn-id: r36021
2009-01-23 04:45:44 +00:00
Max Horn
9861afd8fd Renamed ArchiveMember::open -> createReadStream, and made it a cv member (const); same for Archive::openFile
svn-id: r36020
2009-01-23 04:36:18 +00:00
Max Horn
8f16458e9b Renamed FSNode::openForReading / openForWriting to createReadStream / createWriteStream, again to make ownership of the returned stream clear
svn-id: r36014
2009-01-23 03:41:36 +00:00
Max Horn
87a2747744 Turned FSNode into a ArchiveMember subclass; removed the now obsolete FSDirectoryMember; moved FSDirectory from common/archive.h to common/fs.h
svn-id: r35578
2008-12-27 18:03:27 +00:00
Max Horn
2fec0a3088 Moved addDirectory from SearchManager to SearchSet; changed several places from using '++it' instead of 'it++' to iterate over a list (this is more efficient)
svn-id: r35576
2008-12-27 17:16:48 +00:00
Jordi Vilalta Prat
b1999a2a16 Fixed indentation and removed whitespaces at the end of line
svn-id: r35481
2008-12-22 11:22:15 +00:00
Johannes Schickel
1f0b94a9ca Committed slightly modified version of my patch at bug tracker item #2309974 "ALL: */? match path separator in FSDir::listMatchingMembers".
svn-id: r35450
2008-12-20 15:04:17 +00:00
Max Horn
ea3d4fe22d cleanup
svn-id: r35381
2008-12-15 12:55:13 +00:00
Johannes Schickel
858de9b938 Formatting / Cleanup.
svn-id: r35141
2008-11-21 17:49:19 +00:00
Willem Jan Palenstijn
196e2cc92c refactor inconsistent calls to cacheDirectoryRecursive
svn-id: r35140
2008-11-21 13:29:53 +00:00
Max Horn
a28b531ed0 Added ArchiveMember::getDisplayName() method; changed ArchiveMember::getName() to always return a name compatible with Archive::openFile()
svn-id: r35139
2008-11-21 12:17:35 +00:00
Nicola Mettifogo
71d7b5762a Reverted my earlier commit r34926.
svn-id: r34930
2008-11-07 13:50:56 +00:00
Johannes Schickel
4cc5015fd0 Fixed leak when using SearchSet::add for an already existing name.
svn-id: r34928
2008-11-07 13:42:05 +00:00
Nicola Mettifogo
203db86869 Fixed leaks in SearchMan. Default directories are now added with the 'autoFree' parameter set to true.
svn-id: r34926
2008-11-07 11:09:16 +00:00
Johannes Schickel
282ebbb0e5 Commit of patch #2207782 "ARCHIVE: New method 'getMember'".
svn-id: r34871
2008-11-01 12:49:29 +00:00
Johannes Schickel
7d331b7341 Committed updated version of my patch #2184529 "SearchSet: Get rid of SharedPtr usage".
svn-id: r34837
2008-10-22 17:44:12 +00:00
Max Horn
f881b95ddd Removed File::addDefaultDirectoryRecursive, tweaked SearchMan API slightly
svn-id: r34836
2008-10-22 17:08:17 +00:00
Johannes Schickel
ffdbb474c4 Removed SearchManager::addArchive, since SearchManager::add offers the same functionallity.
svn-id: r34795
2008-10-13 15:07:37 +00:00
Nicola Mettifogo
fb0d112bbd * Added prefix support to cache entries of FSDirectory, as specified in patch #2034983.
* Updated comments on most Archive-related classes.

svn-id: r34776
2008-10-12 06:06:04 +00:00
Nicola Mettifogo
5dd381932f Added an optional depth parameter to FSDirectory::getSubDirectory(), so that returned FSDirectory can be more flexibly configured.
svn-id: r34756
2008-10-08 09:05:21 +00:00
Johannes Schickel
e417471177 Committed slightly modified patch #2034983 "Case-insensitivy and directory handling for engines".
svn-id: r34734
2008-10-03 16:57:40 +00:00
Max Horn
d269a84e03 Add the current dir to the global SearchSet, i.e. to SearchMan (this should fix the problems on Windows, and maybe other systems, see 'bug' #2137680)
svn-id: r34721
2008-10-02 17:52:29 +00:00
Max Horn
c7fde102e3 Renamed FilesystemNode -> FSNode
svn-id: r34716
2008-10-02 16:58:59 +00:00
Gregory Montoir
cb4caae8eb add constructor to SearchSet::Node for proper init of structure members with gcc 3.4.x (see tracker items #2120595, #2106292)
svn-id: r34686
2008-09-29 19:09:56 +00:00
Max Horn
00ca130f19 Add priority parameter to the SearchMan API
svn-id: r34679
2008-09-29 10:30:31 +00:00
Max Horn
0d34b772a4 Fixed a nasty bug in SearchManager::addDirectory; made the 'char' constructor of Common::String explicit, to avoid such bugs in the future
svn-id: r34660
2008-09-27 18:34:24 +00:00
Max Horn
479e67f2f2 Modified Common::SearchSet to take signed integer priorities, for convenience (so that one can add archives with less-than-default priority)
svn-id: r34659
2008-09-27 18:32:01 +00:00
Vicent Marti
6699a596ed Fixed "empty control statement" warning in FSDirectory::matchPattern().
svn-id: r34605
2008-09-20 10:32:59 +00:00
Max Horn
722d134e7e Added 'native' implementations for FSDirectory::matchPattern & SearchSet::getAllNames (untested)
svn-id: r34599
2008-09-18 08:19:00 +00:00