summaryrefslogtreecommitdiff
path: root/shared/long_path_prefix.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:08:06 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:08:06 +0200
commitfbe76102e941b9f1edaf236788e42678f05fdf9a (patch)
treef5f538316019fa89be8dc478103490c3a826f3ac /shared/long_path_prefix.h
parent3.8 (diff)
downloadFreeFileSync-fbe76102e941b9f1edaf236788e42678f05fdf9a.tar.gz
FreeFileSync-fbe76102e941b9f1edaf236788e42678f05fdf9a.tar.bz2
FreeFileSync-fbe76102e941b9f1edaf236788e42678f05fdf9a.zip
3.9
Diffstat (limited to 'shared/long_path_prefix.h')
-rw-r--r--shared/long_path_prefix.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/shared/long_path_prefix.h b/shared/long_path_prefix.h
new file mode 100644
index 00000000..b14a17dc
--- /dev/null
+++ b/shared/long_path_prefix.h
@@ -0,0 +1,30 @@
+// **************************************************************************
+// * This file is part of the FreeFileSync project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
+// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) *
+// **************************************************************************
+//
+#ifndef LONGPATHPREFIX_H_INCLUDED
+#define LONGPATHPREFIX_H_INCLUDED
+
+#ifndef FFS_WIN
+use in windows build only!
+#endif
+
+#include "zstring.h"
+
+namespace ffs3
+{
+//handle filenames longer-equal 260 (== MAX_PATH) characters by applying \\?\-prefix (Reference: http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath)
+/*
+1. path must be absolute
+2. if path is smaller than MAX_PATH nothing is changed!
+3. path may already contain \\?\-prefix
+*/
+Zstring applyLongPathPrefix(const Zstring& path); //throw()
+Zstring applyLongPathPrefixCreateDir(const Zstring& path); //throw() -> special rule for ::CreateDirectoryEx(): MAX_PATH - 12(=^ 8.3 filename) is threshold
+
+Zstring removeLongPathPrefix(const Zstring& path); //throw()
+}
+
+#endif // LONGPATHPREFIX_H_INCLUDED
bgstack15