summaryrefslogtreecommitdiff
path: root/chromium/ppapi/shared_impl/file_ref_util.h
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-08-15 21:46:11 +0200
committerZeno Albisser <zeno.albisser@digia.com>2013-08-15 21:46:11 +0200
commit679147eead574d186ebf3069647b4c23e8ccace6 (patch)
treefc247a0ac8ff119f7c8550879ebb6d3dd8d1ff69 /chromium/ppapi/shared_impl/file_ref_util.h
downloadqtwebengine-chromium-679147eead574d186ebf3069647b4c23e8ccace6.tar.gz
Initial import.
Diffstat (limited to 'chromium/ppapi/shared_impl/file_ref_util.h')
-rw-r--r--chromium/ppapi/shared_impl/file_ref_util.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/chromium/ppapi/shared_impl/file_ref_util.h b/chromium/ppapi/shared_impl/file_ref_util.h
new file mode 100644
index 00000000000..f85527daeff
--- /dev/null
+++ b/chromium/ppapi/shared_impl/file_ref_util.h
@@ -0,0 +1,35 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_SHARED_IMPL_FILE_REF_UTIL_H_
+#define PPAPI_SHARED_IMPL_FILE_REF_UTIL_H_
+
+#include <string>
+
+#include "ppapi/shared_impl/ppapi_shared_export.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace ppapi {
+
+// Routines to generate display names for internal and external file paths.
+PPAPI_SHARED_EXPORT std::string GetNameForInternalFilePath(
+ const std::string& path);
+PPAPI_SHARED_EXPORT std::string GetNameForExternalFilePath(
+ const base::FilePath& path);
+
+// Determines whether an internal file path is valid.
+PPAPI_SHARED_EXPORT bool IsValidInternalPath(const std::string& path);
+
+// Determines whether an external file path is valid.
+PPAPI_SHARED_EXPORT bool IsValidExternalPath(const base::FilePath& path);
+
+// If path ends with a slash, normalize it away unless it's the root path.
+PPAPI_SHARED_EXPORT void NormalizeInternalPath(std::string* path);
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_FILE_REF_UTIL_H_