Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: include/core/SkOSFile.h

Issue 15747004: Add path utils, plus a test for it. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove unnecessary changes. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 // TODO: add unittests for all these operations 10 // TODO: add unittests for all these operations
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 ~SkUTF16_Str() 98 ~SkUTF16_Str()
99 { 99 {
100 sk_free(fStr); 100 sk_free(fStr);
101 } 101 }
102 const uint16_t* get() const { return fStr; } 102 const uint16_t* get() const { return fStr; }
103 103
104 private: 104 private:
105 uint16_t* fStr; 105 uint16_t* fStr;
106 }; 106 };
107 107
108 /**
109 * Functions for modifying SkStrings which represent paths on the filesystem.
110 */
111 namespace SkOSPathUtils {
112 /**
113 * Assembles rootPath and relativePath into a single path, like this:
114 * rootPath/relativePath
115 *
116 * Uses SkPATH_SEPARATOR, to work on all platforms.
117 */
118 SkString SkPathJoin(const char *rootPath, const char *relativePath);
epoger 2013/05/24 16:42:55 Rather than creating the new SkOSPathUtils namespa
scroggo 2013/05/24 17:36:05 I like that better. Done.
119
120 /**
121 * Return the name of the file, ignoring the directory structure.
122 * Behaves like python's os.path.basename. If the fullPath is
123 * /dir/subdir/, an empty string is returned.
124 * @param fullPath Full path to the file.
125 * @return SkString The basename of the file - anything beyond the
126 * final slash, or the full name if there is no slash.
127 */
128 SkString SkBasename(const char* fullPath);
129 }
108 #endif 130 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698