@@ -278,11 +278,12 @@ namespace Paths {
278278 // endregion
279279
280280 // region transformation
281- const std::string Extensions::MAKEFILE_EXTENSION = " .mk" ;
282- const std::string Extensions::TEST_SUFFIX = " _test" ;
283- const std::string Extensions::STUB_SUFFIX = " _stub" ;
284- const std::string Extensions::DOT_SEP = " _dot_" ;
285- const std::string Extensions::MAKE_WRAPPER_SUFFIX = " _wrapper" ;
281+ const std::string MAKEFILE_EXTENSION = " .mk" ;
282+ const std::string TEST_SUFFIX = " _test" ;
283+ const std::string STUB_SUFFIX = " _stub" ;
284+ const std::string DOT_SEP = " _dot_" ;
285+ const std::string MAKE_WRAPPER_SUFFIX = " _wrapper" ;
286+ const char dot = ' .' ;
286287
287288 fs::path sourcePathToTestPath (const utbot::ProjectContext &projectContext,
288289 const fs::path &sourceFilePath) {
@@ -295,7 +296,7 @@ namespace Paths {
295296 std::string extensionAsSuffix = path.extension ().string ();
296297 if (!extensionAsSuffix.empty ()) {
297298 std::string fnWithNewExt =
298- path.stem ().string () + Extensions:: DOT_SEP + extensionAsSuffix.substr (1 ) + newExt;
299+ path.stem ().string () + DOT_SEP + extensionAsSuffix.substr (1 ) + newExt;
299300 return path.parent_path () / fnWithNewExt;
300301 }
301302 return replaceExtension (path, newExt);
@@ -305,32 +306,32 @@ namespace Paths {
305306 const std::string &defaultExt) {
306307 std::string fnWithoutExt = path.stem ();
307308 fs::path fnWithExt;
308- std::size_t posEncodedExtension = fnWithoutExt.rfind (Extensions:: DOT_SEP);
309+ std::size_t posEncodedExtension = fnWithoutExt.rfind (DOT_SEP);
309310 if (posEncodedExtension == std::string::npos) {
310311 // In `sample_class_test.cpp` the `class` is not an extension
311312 fnWithExt = fnWithoutExt + defaultExt;
312313 }
313314 else {
314315 // In `sample_class_dot_cpp.cpp` the `cpp` is an extension
315316 fnWithExt = fnWithoutExt.substr (0 , posEncodedExtension)
316- + Extensions:: dot
317- + fnWithoutExt.substr (posEncodedExtension + Extensions:: DOT_SEP.length ());
317+ + dot
318+ + fnWithoutExt.substr (posEncodedExtension + DOT_SEP.length ());
318319 }
319320 return path.parent_path () / fs::path (fnWithExt);
320321 }
321322
322323 fs::path sourcePathToTestName (const fs::path &source) {
323324 return addSuffix (addOrigExtensionAsSuffixAndAddNew (source, " .cpp" ),
324- Extensions:: TEST_SUFFIX).filename ();
325+ TEST_SUFFIX).filename ();
325326 }
326327 fs::path testPathToSourceName (const fs::path &testFilePath) {
327- return restoreExtensionFromSuffix (removeSuffix (testFilePath, Extensions:: TEST_SUFFIX), " .c" ).filename ();
328+ return restoreExtensionFromSuffix (removeSuffix (testFilePath, TEST_SUFFIX), " .c" ).filename ();
328329 }
329330 fs::path sourcePathToStubName (const fs::path &source) {
330- return addSuffix (source, Extensions:: STUB_SUFFIX).filename ();
331+ return addSuffix (source, STUB_SUFFIX).filename ();
331332 }
332333 fs::path getStubBitcodeFilePath (const fs::path &bitcodeFilePath) {
333- return Paths::addSuffix (bitcodeFilePath, Extensions:: STUB_SUFFIX);
334+ return Paths::addSuffix (bitcodeFilePath, STUB_SUFFIX);
334335 }
335336
336337 fs::path sourcePathToStubHeaderPath (const utbot::ProjectContext &projectContext,
@@ -362,15 +363,15 @@ namespace Paths {
362363 if (!suffix.empty ()) {
363364 addSuffix (makefileDir, suffix);
364365 }
365- std::string makefileName = replaceExtension (sourceFilePath, Extensions:: MAKEFILE_EXTENSION).filename ();
366+ std::string makefileName = replaceExtension (sourceFilePath, MAKEFILE_EXTENSION).filename ();
366367 return makefileDir / makefileName;
367368 }
368369
369370 fs::path getStubsMakefilePath (const utbot::ProjectContext &projectContext,
370371 const fs::path &sourceFilePath) {
371372 fs::path makefileDir = getMakefileDir (projectContext, sourceFilePath);
372373 std::string makefileName =
373- addExtension (addSuffix (sourceFilePath.stem (), Extensions:: STUB_SUFFIX), Extensions:: MAKEFILE_EXTENSION);
374+ addExtension (addSuffix (sourceFilePath.stem (), STUB_SUFFIX), MAKEFILE_EXTENSION);
374375 return makefileDir / makefileName;
375376 }
376377
@@ -409,11 +410,11 @@ namespace Paths {
409410 fs::path sourceFilePath =
410411 projectContext.projectPath /
411412 fs::relative (stubPath, getStubsDirPath (projectContext));
412- return removeSuffix (sourceFilePath, Extensions:: STUB_SUFFIX);
413+ return removeSuffix (sourceFilePath, STUB_SUFFIX);
413414 }
414415
415416 bool isHeadersEqual (const fs::path &srcPath, const fs::path &headerPath) {
416- return removeSuffix (srcPath, Extensions:: STUB_SUFFIX).stem () == headerPath.stem ();
417+ return removeSuffix (srcPath, STUB_SUFFIX).stem () == headerPath.stem ();
417418 }
418419 fs::path getUtbotBuildDir (const utbot::ProjectContext &projectContext) {
419420 return projectContext.buildDir / CompilationUtils::UTBOT_BUILD_DIR_NAME;
0 commit comments