summaryrefslogtreecommitdiffstats
path: root/webkit/port/platform/chromium/FileSystemPosix.cpp
blob: 0264d9e3d84fc496b81059ece1e0f47dc652211b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) 2006-2008 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.

#include "config.h"

#include <string>

#include "FileSystem.h"
#include "CString.h"

#include "base/sys_string_conversions.h"
#include "webkit/glue/glue_util.h"

namespace WebCore {

// This function is tasked with transforming a String to a CString for the
// underlying operating system. On Linux the kernel doesn't care about the
// filenames so long as NUL and '/' are respected. UTF8 filenames seem to be
// pretty common, but are not universal so we punt on the decision here and pass
// the buck to a function in base.
CString fileSystemRepresentation(const String &path) {
    return webkit_glue::StdStringToCString(
        base::SysWideToNativeMB(webkit_glue::StringToStdWString(path)));
}

}