Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add license headers to files. Adapt include guards to KDevelop conven…

…tion.
  • Loading branch information...
commit fdcfe9ca90651e8cbc24f79d458a8b8b5028fd46 1 parent 12c33b1
@mschuerig authored
View
16 src/DirectoryMetadata.cpp
@@ -1,3 +1,19 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
#include "DirectoryMetadata.h"
View
22 src/DirectoryMetadata.h
@@ -1,6 +1,22 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
-#ifndef DIRECTORY_METADATA_H_INCLUDED_
-#define DIRECTORY_METADATA_H_INCLUDED_
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef DIRECTORYMETADATA_H
+#define DIRECTORYMETADATA_H
#include "NameShortener.h"
@@ -76,4 +92,4 @@ class DirectoryMetadata : public boost::noncopyable {
const boost::shared_ptr<Etc> etc_;
};
-#endif // DIRECTORY_METADATA_H_INCLUDED_
+#endif // DIRECTORYMETADATA_H
View
16 src/Etc.cpp
@@ -1,3 +1,19 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
#include "Etc.h"
View
22 src/Etc.h
@@ -1,6 +1,22 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
-#ifndef ETC_H_INCLUDED
-#define ETC_H_INCLUDED
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef ETC_H
+#define ETC_H
#include <sys/types.h>
#include <string>
@@ -19,4 +35,4 @@ class Etc : public boost::noncopyable {
gid_t lookupGroupId(const std::string& group) const;
};
-#endif // ETC_H_INCLUDED
+#endif // ETC_H
View
22 src/IdentityShortener.h
@@ -1,6 +1,22 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
-#ifndef IDENTITY_SHORTENER_H_INCLUDED_
-#define IDENTITY_SHORTENER_H_INCLUDED_
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef IDENTITYSHORTENER_H
+#define IDENTITYSHORTENER_H
#include "NameShortener.h"
#include <string>
@@ -13,4 +29,4 @@ class IdentityShortener : public NameShortener
}
};
-#endif // IDENTITY_SHORTENER_H_INCLUDED_
+#endif // IDENTITYSHORTENER_H
View
16 src/MD5Shortener.cpp
@@ -1,3 +1,19 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
#include "MD5Shortener.h"
View
23 src/MD5Shortener.h
@@ -1,6 +1,22 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
-#ifndef MD5_SHORTENER_INCLUDED_H_
-#define MD5_SHORTENER_INCLUDED_H_
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef MD5SHORTENER_H
+#define MD5SHORTENER_H
#include "NameShortener.h"
#include <string>
@@ -10,5 +26,4 @@ class MD5Shortener : public NameShortener {
virtual std::string shorten(const std::string& longName);
};
-#endif // MD5_SHORTENER_INCLUDED_H_
-
+#endif // MD5SHORTENER_H
View
22 src/NameShortener.h
@@ -1,6 +1,22 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
-#ifndef NAME_SHORTENER_INCLUDED_H_
-#define NAME_SHORTENER_INCLUDED_H_
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef NAMESHORTENER_H
+#define NAMESHORTENER_H
#include <string>
@@ -22,4 +38,4 @@ class NameShortener {
virtual void doReset() {}
};
-#endif // NAME_SHORTENER_INCLUDED_H_
+#endif // NAMESHORTENER_H
View
16 src/TruncatingShortener.cpp
@@ -1,3 +1,19 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
#include "TruncatingShortener.h"
#include <cassert>
View
24 src/TruncatingShortener.h
@@ -1,6 +1,22 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
-#ifndef TRUNCATING_SHORTENER_INCLUDED_H_
-#define TRUNCATING_SHORTENER_INCLUDED_H_
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef TRUNCATINGSHORTENER_H
+#define TRUNCATINGSHORTENER_H
#include "NameShortener.h"
#include <set>
@@ -18,6 +34,4 @@ class TruncatingShortener : public NameShortener {
virtual void reset();
};
-#endif // TRUNCATING_SHORTENER_INCLUDED_H_
-
-
+#endif // TRUNCATINGSHORTENER_H
View
22 src/algorithm.h
@@ -1,6 +1,22 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
-#ifndef ALGORITHM_H_INCLUDED_
-#define ALGORITHM_H_INCLUDED_
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef ALGORITHM_H
+#define ALGORITHM_H
#include <map>
@@ -22,4 +38,4 @@ index_by(const T& t, R T::value_type::*ptr_to_mem)
} // namespace algorithm
-#endif // ALGORITHM_H_INCLUDED_
+#endif // ALGORITHM_H
View
16 src/dirmeta.cpp
@@ -1,3 +1,19 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
#include <iostream>
#include "DirectoryMetadata.h"
View
16 src/exception.cpp
@@ -1,3 +1,19 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
#include "exception.h"
#include <cstring>
View
22 src/exception.h
@@ -1,6 +1,22 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
-#ifndef EXCEPTION_H_INCLUDED_
-#define EXCEPTION_H_INCLUDED_
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef EXCEPTION_H
+#define EXCEPTION_H
#include <cerrno>
#include <string>
@@ -49,4 +65,4 @@ class CatchAll : protected CatchAllBase {
} // namespace exception
-#endif // EXCEPTION_H_INCLUDED_
+#endif // EXCEPTION_H
View
66 src/transpath.cpp
@@ -1,3 +1,19 @@
+/*
+ Copyright (C) 2011 Michael Schuerig <michael@schuerig.de>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
#include "DirectoryMetadata.h"
#include "TruncatingShortener.h"
@@ -37,31 +53,31 @@ translate( const string& longPath, NameShortener& shortener) {
DirectoryMetadata::Ptr dm;
foreach( fs::path part, path ) {
- if ( fs::is_directory(prefixPath) ) {
- shortener.reset();
- dm = DirectoryMetadata::fromFilesystem(prefixPath.string(), shortener);
- } else {
- BOOST_THROW_EXCEPTION(
- PathTranslationError()
- << boost::errinfo_file_name(prefixPath.string())
- << boost::errinfo_errno(ENOTDIR)
- );
- }
-
- EntryMap entryMap = algorithm::index_by(*dm, &DirectoryMetadata::Entry::longName);
-
- EntryMap::const_iterator ep( entryMap.find(part.string()) );
- if ( ep != entryMap.end() ) {
- resultPath /= ep->second.shortName;
- } else {
- BOOST_THROW_EXCEPTION(
- PathTranslationError()
- << boost::errinfo_file_name(part.string())
- << boost::errinfo_errno(ENOENT)
- );
- }
-
- prefixPath /= part;
+ if ( fs::is_directory(prefixPath) ) {
+ shortener.reset();
+ dm = DirectoryMetadata::fromFilesystem(prefixPath.string(), shortener);
+ } else {
+ BOOST_THROW_EXCEPTION(
+ PathTranslationError()
+ << boost::errinfo_file_name(prefixPath.string())
+ << boost::errinfo_errno(ENOTDIR)
+ );
+ }
+
+ EntryMap entryMap = algorithm::index_by(*dm, &DirectoryMetadata::Entry::longName);
+
+ EntryMap::const_iterator ep( entryMap.find(part.string()) );
+ if ( ep != entryMap.end() ) {
+ resultPath /= ep->second.shortName;
+ } else {
+ BOOST_THROW_EXCEPTION(
+ PathTranslationError()
+ << boost::errinfo_file_name(part.string())
+ << boost::errinfo_errno(ENOENT)
+ );
+ }
+
+ prefixPath /= part;
}
return resultPath.string();
}

0 comments on commit fdcfe9c

Please sign in to comment.
Something went wrong with that request. Please try again.