MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / validatePath

Function validatePath

source/base/StarAssets.cpp:62–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62static void validatePath(AssetPath const& components, bool canContainSubPath, bool canContainDirectives) {
63 validateBasePath(components.basePath.utf8());
64
65 if (!canContainSubPath && components.subPath)
66 throw AssetException::format("Path '{}' cannot contain sub-path", components);
67 if (!canContainDirectives && !components.directives.empty())
68 throw AssetException::format("Path '{}' cannot contain directives", components);
69}
70
71static void validatePath(StringView path, bool canContainSubPath, bool canContainDirectives) {
72 std::string_view const& str = path.utf8();

Callers 12

AssetsMethod · 0.85
jsonMethod · 0.85
queueJsonsMethod · 0.85
queueImagesMethod · 0.85
tryImageMethod · 0.85
imageFramesMethod · 0.85
audioMethod · 0.85
queueAudiosMethod · 0.85
tryAudioMethod · 0.85
fontMethod · 0.85
bytesMethod · 0.85
loadImageMethod · 0.85

Calls 5

validateBasePathFunction · 0.85
formatFunction · 0.50
emptyMethod · 0.45
substrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected