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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
|
#include "slang-file-system.h"
#include "../../slang-com-ptr.h"
#include "../core/slang-io.h"
#include "../core/slang-string-util.h"
namespace Slang
{
// Allocate static const storage for the various interface IDs that the Slang API needs to expose
static const Guid IID_ISlangUnknown = SLANG_UUID_ISlangUnknown;
static const Guid IID_ISlangFileSystem = SLANG_UUID_ISlangFileSystem;
static const Guid IID_ISlangFileSystemExt = SLANG_UUID_ISlangFileSystemExt;
static const Guid IID_SlangCacheFileSystem = SLANG_UUID_CacheFileSystem;
// Cacluate a combined path, just using Path:: string processing
static SlangResult _calcCombinedPath(SlangPathType fromPathType, const char* fromPath, const char* path, ISlangBlob** pathOut)
{
String relPath;
switch (fromPathType)
{
case SLANG_PATH_TYPE_FILE:
{
relPath = Path::combine(Path::getParentDirectory(fromPath), path);
break;
}
case SLANG_PATH_TYPE_DIRECTORY:
{
relPath = Path::combine(fromPath, path);
break;
}
}
*pathOut = StringUtil::createStringBlob(relPath).detach();
return SLANG_OK;
}
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!! OSFileSystem !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/* static */OSFileSystem OSFileSystem::s_singleton;
ISlangUnknown* OSFileSystem::getInterface(const Guid& guid)
{
return (guid == IID_ISlangUnknown || guid == IID_ISlangFileSystem ) ? static_cast<ISlangFileSystem*>(this) : nullptr;
}
/* !!!!!!!!!!!!!!!!!!!!!!!!!! OSFileSystemExt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/* static */OSFileSystemExt OSFileSystemExt::s_singleton;
template <typename T>
static ISlangFileSystemExt* _getInterface(T* ptr, const Guid& guid)
{
return (guid == IID_ISlangUnknown || guid == IID_ISlangFileSystem || guid == IID_ISlangFileSystemExt) ? static_cast<ISlangFileSystemExt*>(ptr) : nullptr;
}
ISlangUnknown* OSFileSystemExt::getInterface(const Guid& guid)
{
return _getInterface(this, guid);
}
static String _fixPathDelimiters(const char* pathIn)
{
#if SLANG_WINDOWS_FAMILY
return pathIn;
#else
// To allow windows style \ delimiters on other platforms, we convert to our standard delimiter
String path(pathIn);
return StringUtil::calcCharReplaced(pathIn, '\\', Path::kPathDelimiter);
#endif
}
SlangResult OSFileSystemExt::getFileUniqueIdentity(const char* pathIn, ISlangBlob** outUniqueIdentity)
{
// By default we use the canonical path to uniquely identify a file
return getCanonicalPath(pathIn, outUniqueIdentity);
}
SlangResult OSFileSystemExt::getCanonicalPath(const char* path, ISlangBlob** outCanonicalPath)
{
String canonicalPath;
SLANG_RETURN_ON_FAIL(Path::getCanonical(_fixPathDelimiters(path), canonicalPath));
*outCanonicalPath = StringUtil::createStringBlob(canonicalPath).detach();
return SLANG_OK;
}
SlangResult OSFileSystemExt::getSimplifiedPath(const char* pathIn, ISlangBlob** outSimplifiedPath)
{
String simplifiedPath = Path::simplify(_fixPathDelimiters(pathIn));
*outSimplifiedPath = StringUtil::createStringBlob(simplifiedPath).detach();
return SLANG_OK;
}
SlangResult OSFileSystemExt::calcCombinedPath(SlangPathType fromPathType, const char* fromPath, const char* path, ISlangBlob** pathOut)
{
// Don't need to fix delimiters - because combine path handles both path delimiter types
return _calcCombinedPath(fromPathType, fromPath, path, pathOut);
}
SlangResult SLANG_MCALL OSFileSystemExt::getPathType(const char* pathIn, SlangPathType* pathTypeOut)
{
return Path::getPathType(_fixPathDelimiters(pathIn), pathTypeOut);
}
SlangResult OSFileSystemExt::loadFile(char const* pathIn, ISlangBlob** outBlob)
{
// Default implementation that uses the `core` libraries facilities for talking to the OS filesystem.
//
// TODO: we might want to conditionally compile these in, so that
// a user could create a build of Slang that doesn't include any OS
// filesystem calls.
const String path = _fixPathDelimiters(pathIn);
if (!File::exists(path))
{
return SLANG_E_NOT_FOUND;
}
try
{
String sourceString = File::readAllText(path);
*outBlob = StringUtil::createStringBlob(sourceString).detach();
return SLANG_OK;
}
catch (...)
{
}
return SLANG_E_CANNOT_OPEN;
}
SLANG_NO_THROW SlangResult SLANG_MCALL OSFileSystemExt::saveFile(const char* pathIn, const void* data, size_t size)
{
const String path = _fixPathDelimiters(pathIn);
try
{
FileStream stream(pathIn, FileMode::Create, FileAccess::Write, FileShare::ReadWrite);
int64_t numWritten = stream.write(data, size);
if (numWritten != int64_t(size))
{
return SLANG_FAIL;
}
}
catch (const IOException&)
{
return SLANG_E_CANNOT_OPEN;
}
return SLANG_OK;
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CacheFileSystem !!!!!!!!!!!!!!!!!!!!!!!!!!!
/* static */ const Result CacheFileSystem::s_compressedResultToResult[] =
{
SLANG_E_UNINITIALIZED,
SLANG_OK, ///< Ok
SLANG_E_NOT_FOUND, ///< File not found
SLANG_E_CANNOT_OPEN, ///< CannotOpen,
SLANG_FAIL, ///< Fail
};
/* static */CacheFileSystem::CompressedResult CacheFileSystem::toCompressedResult(Result res)
{
if (SLANG_SUCCEEDED(res))
{
return CompressedResult::Ok;
}
switch (res)
{
case SLANG_E_CANNOT_OPEN: return CompressedResult::CannotOpen;
case SLANG_E_NOT_FOUND: return CompressedResult::NotFound;
default: return CompressedResult::Fail;
}
}
ISlangUnknown* CacheFileSystem::getInterface(const Guid& guid)
{
return _getInterface(this, guid);
}
SLANG_NO_THROW SlangResult SLANG_MCALL CacheFileSystem::queryInterface(SlangUUID const& uuid, void** outObject)
{
if (uuid == IID_SlangCacheFileSystem)
{
*outObject = this;
return SLANG_OK;
}
ISlangUnknown* intf = getInterface(uuid);
if (intf)
{
addReference();
*outObject = intf;
return SLANG_OK;
}
return SLANG_E_NO_INTERFACE;
}
CacheFileSystem::CacheFileSystem(ISlangFileSystem* fileSystem, UniqueIdentityMode uniqueIdentityMode, PathStyle pathStyle)
{
setInnerFileSystem(fileSystem, uniqueIdentityMode, pathStyle);
}
CacheFileSystem::~CacheFileSystem()
{
for (const auto& pair : m_uniqueIdentityMap)
{
delete pair.Value;
}
}
void CacheFileSystem::setInnerFileSystem(ISlangFileSystem* fileSystem, UniqueIdentityMode uniqueIdentityMode, PathStyle pathStyle)
{
m_fileSystem = fileSystem;
m_uniqueIdentityMode = uniqueIdentityMode;
m_pathStyle = pathStyle;
m_fileSystemExt.setNull();
if (fileSystem)
{
// Try to get the more sophisticated interface
fileSystem->queryInterface(IID_ISlangFileSystemExt, (void**)m_fileSystemExt.writeRef());
}
switch (m_uniqueIdentityMode)
{
case UniqueIdentityMode::Default:
case UniqueIdentityMode::FileSystemExt:
{
// If it's not a complete file system, we will default to SimplifyAndHash style by default
m_uniqueIdentityMode = m_fileSystemExt ? UniqueIdentityMode::FileSystemExt : UniqueIdentityMode::SimplifyPathAndHash;
break;
}
default: break;
}
if (pathStyle == PathStyle::Default)
{
// We'll assume it's simplify-able
m_pathStyle = PathStyle::Simplifiable;
// If we have fileSystemExt, we defer to that
if (m_fileSystemExt)
{
// We just defer to the m_fileSystem
m_pathStyle = PathStyle::FileSystemExt;
}
}
// It can't be default
SLANG_ASSERT(m_uniqueIdentityMode != UniqueIdentityMode::Default);
}
void CacheFileSystem::clearCache()
{
for (const auto& pair : m_uniqueIdentityMap)
{
delete pair.Value;
}
m_uniqueIdentityMap.Clear();
m_pathMap.Clear();
if (m_fileSystemExt)
{
m_fileSystemExt->clearCache();
}
}
// Determines if we can simplify a path for a given mode
static bool _canSimplifyPath(CacheFileSystem::UniqueIdentityMode mode)
{
typedef CacheFileSystem::UniqueIdentityMode UniqueIdentityMode;
switch (mode)
{
case UniqueIdentityMode::SimplifyPath:
case UniqueIdentityMode::SimplifyPathAndHash:
{
return true;
}
default:
{
return false;
}
}
}
SlangResult CacheFileSystem::_calcUniqueIdentity(const String& path, String& outUniqueIdentity, ComPtr<ISlangBlob>& outFileContents)
{
switch (m_uniqueIdentityMode)
{
case UniqueIdentityMode::FileSystemExt:
{
// Try getting the uniqueIdentity by asking underlying file system
ComPtr<ISlangBlob> uniqueIdentity;
SLANG_RETURN_ON_FAIL(m_fileSystemExt->getFileUniqueIdentity(path.getBuffer(), uniqueIdentity.writeRef()));
// Get the path as a string
outUniqueIdentity = StringUtil::getString(uniqueIdentity);
return SLANG_OK;
}
case UniqueIdentityMode::Path:
{
outUniqueIdentity = path;
return SLANG_OK;
}
case UniqueIdentityMode::SimplifyPath:
{
outUniqueIdentity = Path::simplify(path);
// If it still has relative elements can't uniquely identify, so give up
return Path::hasRelativeElement(outUniqueIdentity) ? SLANG_FAIL : SLANG_OK;
}
case UniqueIdentityMode::SimplifyPathAndHash:
case UniqueIdentityMode::Hash:
{
// If we don't have a file system -> assume cannot be found
if (m_fileSystem == nullptr)
{
return SLANG_E_NOT_FOUND;
}
// I can only see if this is the same file as already loaded by loading the file and doing a hash
Result res = m_fileSystem->loadFile(path.getBuffer(), outFileContents.writeRef());
if (SLANG_FAILED(res) || outFileContents == nullptr)
{
return SLANG_FAIL;
}
// Calculate the hash on the contents
const uint64_t hash = getHashCode64((const char*)outFileContents->getBufferPointer(), outFileContents->getBufferSize());
String hashString = Path::getFileName(path);
hashString = hashString.toLower();
hashString.append(':');
// The uniqueIdentity is a combination of name and hash
hashString.append(hash, 16);
outUniqueIdentity = hashString;
return SLANG_OK;
}
}
return SLANG_FAIL;
}
CacheFileSystem::PathInfo* CacheFileSystem::_resolveUniqueIdentityCacheInfo(const String& path)
{
// Use the path to produce uniqueIdentity information
ComPtr<ISlangBlob> fileContents;
String uniqueIdentity;
SlangResult res = _calcUniqueIdentity(path, uniqueIdentity, fileContents);
if (SLANG_FAILED(res))
{
// Was not able to create a uniqueIdentity - return failure as nullptr
return nullptr;
}
// Now try looking up by uniqueIdentity path. If not found, add a new result
PathInfo* pathInfo = nullptr;
if (!m_uniqueIdentityMap.TryGetValue(uniqueIdentity, pathInfo))
{
// Create with found uniqueIdentity
pathInfo = new PathInfo(uniqueIdentity);
m_uniqueIdentityMap.Add(uniqueIdentity, pathInfo);
}
// At this point they must have same uniqueIdentity
SLANG_ASSERT(pathInfo->getUniqueIdentity() == uniqueIdentity);
// If we have the file contents (because of calc-ing uniqueIdentity), and there isn't a read file blob already
// store the data as if read, so doesn't get read again
if (fileContents && !pathInfo->m_fileBlob)
{
pathInfo->m_fileBlob = fileContents;
pathInfo->m_loadFileResult = CompressedResult::Ok;
}
return pathInfo;
}
CacheFileSystem::PathInfo* CacheFileSystem::_resolveSimplifiedPathCacheInfo(const String& path)
{
// If we can simplify the path, try looking up in path cache with simplified path (as long as it's different!)
if (_canSimplifyPath(m_uniqueIdentityMode))
{
const String simplifiedPath = Path::simplify(path);
// Only lookup if the path is different - because otherwise will recurse forever...
if (simplifiedPath != path)
{
// This is a recursive call - and will ensure the simplified path is added to the cache
return _resolvePathCacheInfo(simplifiedPath);
}
}
return _resolveUniqueIdentityCacheInfo(path);
}
CacheFileSystem::PathInfo* CacheFileSystem::_resolvePathCacheInfo(const String& path)
{
// Lookup in path cache
PathInfo* pathInfo;
if (m_pathMap.TryGetValue(path, pathInfo))
{
// Found so done
return pathInfo;
}
// Try getting or creating taking into account possible path simplification
pathInfo = _resolveSimplifiedPathCacheInfo(path);
// Always add the result to the path cache (even if null)
m_pathMap.Add(path, pathInfo);
return pathInfo;
}
SlangResult CacheFileSystem::loadFile(char const* pathIn, ISlangBlob** blobOut)
{
*blobOut = nullptr;
String path(pathIn);
PathInfo* info = _resolvePathCacheInfo(path);
if (!info)
{
return SLANG_FAIL;
}
if (info->m_loadFileResult == CompressedResult::Uninitialized)
{
info->m_loadFileResult = toCompressedResult(m_fileSystem->loadFile(path.getBuffer(), info->m_fileBlob.writeRef()));
}
*blobOut = info->m_fileBlob;
if (*blobOut)
{
(*blobOut)->addRef();
}
return toResult(info->m_loadFileResult);
}
SlangResult CacheFileSystem::getFileUniqueIdentity(const char* path, ISlangBlob** outUniqueIdentity)
{
PathInfo* info = _resolvePathCacheInfo(path);
if (!info)
{
return SLANG_E_NOT_FOUND;
}
info->m_uniqueIdentity->addRef();
*outUniqueIdentity = info->m_uniqueIdentity;
return SLANG_OK;
}
SlangResult CacheFileSystem::calcCombinedPath(SlangPathType fromPathType, const char* fromPath, const char* path, ISlangBlob** pathOut)
{
// Just defer to contained implementation
switch (m_pathStyle)
{
case PathStyle::FileSystemExt:
{
return m_fileSystemExt->calcCombinedPath(fromPathType, fromPath, path, pathOut);
}
default:
{
// Just use the default implementation
return _calcCombinedPath(fromPathType, fromPath, path, pathOut);
}
}
}
SlangResult CacheFileSystem::getPathType(const char* pathIn, SlangPathType* pathTypeOut)
{
String path(pathIn);
PathInfo* info = _resolvePathCacheInfo(path);
if (!info)
{
return SLANG_E_NOT_FOUND;
}
if (info->m_getPathTypeResult == CompressedResult::Uninitialized)
{
if (m_fileSystemExt)
{
info->m_getPathTypeResult = toCompressedResult(m_fileSystemExt->getPathType(pathIn, &info->m_pathType));
}
else
{
// Okay try to load the file
if (info->m_loadFileResult == CompressedResult::Uninitialized)
{
info->m_loadFileResult = toCompressedResult(m_fileSystem->loadFile(path.getBuffer(), info->m_fileBlob.writeRef()));
}
// Make the getPathResult the same as the load result
info->m_getPathTypeResult = info->m_loadFileResult;
// Just set to file... the result is what matters in this case
info->m_pathType = SLANG_PATH_TYPE_FILE;
}
}
*pathTypeOut = info->m_pathType;
return toResult(info->m_getPathTypeResult);
}
SlangResult CacheFileSystem::getSimplifiedPath(const char* path, ISlangBlob** outSimplifiedPath)
{
// If we have a ISlangFileSystemExt we can just pass on the request to it
switch (m_pathStyle)
{
case PathStyle::FileSystemExt:
{
return m_fileSystemExt->getSimplifiedPath(path, outSimplifiedPath);
}
case PathStyle::Simplifiable:
{
String simplifiedPath = Path::simplify(_fixPathDelimiters(path));
*outSimplifiedPath = StringUtil::createStringBlob(simplifiedPath).detach();
return SLANG_OK;
}
default: return SLANG_E_NOT_IMPLEMENTED;
}
}
SlangResult CacheFileSystem::getCanonicalPath(const char* path, ISlangBlob** outCanonicalPath)
{
// A file must exist to get a canonical path...
PathInfo* info = _resolvePathCacheInfo(path);
if (!info)
{
return SLANG_E_NOT_FOUND;
}
// We don't have this -> so read it ...
if (info->m_getCanonicalPathResult == CompressedResult::Uninitialized)
{
if (!m_fileSystemExt)
{
return SLANG_E_NOT_IMPLEMENTED;
}
// Try getting the canonicalPath by asking underlying file system
ComPtr<ISlangBlob> canonicalPathBlob;
SlangResult res = m_fileSystemExt->getCanonicalPath(path, canonicalPathBlob.writeRef());
if (SLANG_SUCCEEDED(res))
{
// Get the path as a string
String canonicalPath = StringUtil::getString(canonicalPathBlob);
if (canonicalPath.getLength() > 0)
{
info->m_canonicalPath = new StringBlob(canonicalPath);
}
else
{
res = SLANG_FAIL;
}
}
// Save the result
info->m_getCanonicalPathResult = toCompressedResult(res);
}
if (info->m_canonicalPath)
{
info->m_canonicalPath->addRef();
}
*outCanonicalPath = info->m_canonicalPath;
return SLANG_OK;
}
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! RelativeFileSystem !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
ISlangUnknown* RelativeFileSystem::getInterface(const Guid& guid)
{
return _getInterface(this, guid);
}
SlangResult RelativeFileSystem::_getFixedPath(const char* path, String& outPath)
{
ComPtr<ISlangBlob> blob;
if (m_stripPath)
{
String strippedPath = Path::getFileName(path);
SLANG_RETURN_ON_FAIL(m_fileSystem->calcCombinedPath(SLANG_PATH_TYPE_DIRECTORY, m_relativePath.getBuffer(), strippedPath.getBuffer(), blob.writeRef()));
}
else
{
SLANG_RETURN_ON_FAIL(m_fileSystem->calcCombinedPath(SLANG_PATH_TYPE_DIRECTORY, m_relativePath.getBuffer(), path, blob.writeRef()));
}
outPath = StringUtil::getString(blob);
return SLANG_OK;
}
SLANG_NO_THROW SlangResult SLANG_MCALL RelativeFileSystem::loadFile(char const* path, ISlangBlob** outBlob)
{
String fixedPath;
SLANG_RETURN_ON_FAIL(_getFixedPath(path, fixedPath));
return m_fileSystem->loadFile(fixedPath.getBuffer(), outBlob);
}
SLANG_NO_THROW SlangResult SLANG_MCALL RelativeFileSystem::getFileUniqueIdentity(const char* path, ISlangBlob** outUniqueIdentity)
{
String fixedPath;
SLANG_RETURN_ON_FAIL(_getFixedPath(path, fixedPath));
return m_fileSystem->getFileUniqueIdentity(fixedPath.getBuffer(), outUniqueIdentity);
}
SLANG_NO_THROW SlangResult SLANG_MCALL RelativeFileSystem::calcCombinedPath(SlangPathType fromPathType, const char* fromPath, const char* path, ISlangBlob** outPath)
{
String fixedFromPath;
SLANG_RETURN_ON_FAIL(_getFixedPath(fromPath, fixedFromPath));
return m_fileSystem->calcCombinedPath(fromPathType, fixedFromPath.getBuffer(), path, outPath);
}
SLANG_NO_THROW SlangResult SLANG_MCALL RelativeFileSystem::getPathType(const char* path, SlangPathType* outPathType)
{
String fixedPath;
SLANG_RETURN_ON_FAIL(_getFixedPath(path, fixedPath));
return m_fileSystem->getPathType(fixedPath.getBuffer(), outPathType);
}
SLANG_NO_THROW SlangResult SLANG_MCALL RelativeFileSystem::getSimplifiedPath(const char* path, ISlangBlob** outSimplifiedPath)
{
return m_fileSystem->getSimplifiedPath(path, outSimplifiedPath);
}
SLANG_NO_THROW SlangResult SLANG_MCALL RelativeFileSystem::getCanonicalPath(const char* path, ISlangBlob** outCanonicalPath)
{
String fixedPath;
SLANG_RETURN_ON_FAIL(_getFixedPath(path, fixedPath));
return m_fileSystem->getCanonicalPath(fixedPath.getBuffer(), outCanonicalPath);
}
SLANG_NO_THROW void SLANG_MCALL RelativeFileSystem::clearCache()
{
m_fileSystem->clearCache();
}
SLANG_NO_THROW SlangResult SLANG_MCALL RelativeFileSystem::saveFile(const char* path, const void* data, size_t size)
{
String fixedPath;
SLANG_RETURN_ON_FAIL(_getFixedPath(path, fixedPath));
return m_fileSystem->saveFile(fixedPath.getBuffer(), data, size);
}
}
|