MCPcopy Create free account
hub / github.com/GPUOpen-Tools/compressonator / DefaultDestination

Function DefaultDestination

applications/_plugins/common/cmdline.cpp:112–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112static std::string DefaultDestination(const std::string& sourceFile, CMP_FORMAT destFormat, const std::string& destFileExt, CMP_BOOL suffixDestFormat)
113{
114 std::string destFile = "";
115
116 std::string sourceName = CMP_GetJustFileName(sourceFile);
117 std::string sourceExt = CMP_GetJustFileExt(sourceFile);
118
119 destFile.append(sourceName);
120
121 if (suffixDestFormat)
122 {
123 destFile.append("_");
124 sourceExt.erase(std::remove(sourceExt.begin(), sourceExt.end(), '.'), sourceExt.end());
125 destFile.append(sourceExt);
126 if (destFormat != CMP_FORMAT_BROTLIG && destFormat != CMP_FORMAT_Unknown)
127 {
128 destFile.append("_");
129 destFile.append(GetFormatDesc(destFormat));
130 }
131 }
132 else
133 sourceExt.erase(std::remove(sourceExt.begin(), sourceExt.end(), '.'), sourceExt.end());
134
135 if (destFileExt.find('.') != std::string::npos)
136 {
137 destFile.append(destFileExt);
138 }
139 else
140 {
141#if (OPTION_BUILD_ASTC == 1)
142 if (destFormat == CMP_FORMAT_ASTC)
143 destFile.append(".astc");
144 else
145#endif
146 if (destFormat == CMP_FORMAT_BROTLIG)
147 destFile.append(".brlg");
148 else
149 {
150 destFile.append(".dds");
151 }
152 }
153
154 return destFile;
155}
156
157static inline bool IsFileGLTF(const std::string& sourceFile)
158{

Callers 1

ProcessCMDLineFunction · 0.85

Calls 7

CMP_GetJustFileNameFunction · 0.85
CMP_GetJustFileExtFunction · 0.85
GetFormatDescFunction · 0.85
eraseMethod · 0.80
findMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected