Path: Removed java/c# handling. Thanks amai.
This commit is contained in:
parent
1e024a9abc
commit
dbddbe75bf
12
lib/path.cpp
12
lib/path.cpp
|
@ -192,18 +192,6 @@ bool Path::isCPP(const std::string &path)
|
|||
return(getFilenameExtension(path) == ".C");
|
||||
}
|
||||
|
||||
bool Path::isJava(const std::string &path)
|
||||
{
|
||||
const std::string extension = getFilenameExtensionInLowerCase(path);
|
||||
return(extension == ".java");
|
||||
}
|
||||
|
||||
bool Path::isCSharp(const std::string &path)
|
||||
{
|
||||
const std::string extension = getFilenameExtensionInLowerCase(path);
|
||||
return(extension == ".cs");
|
||||
}
|
||||
|
||||
bool Path::acceptFile(const std::string &filename)
|
||||
{
|
||||
return(Path::isCPP(filename) || Path::isC(filename));
|
||||
|
|
14
lib/path.h
14
lib/path.h
|
@ -115,20 +115,6 @@ public:
|
|||
* @return true if extension is meant for C++ files
|
||||
*/
|
||||
static bool isCPP(const std::string &extensionInLowerCase);
|
||||
|
||||
/**
|
||||
* @brief Identify language based on file extension.
|
||||
* @param extensionInLowerCase e.g. ".java"
|
||||
* @return true if extension is meant for Java files
|
||||
*/
|
||||
static bool isJava(const std::string &extensionInLowerCase);
|
||||
|
||||
/**
|
||||
* @brief Identify language based on file extension.
|
||||
* @param extensionInLowerCase e.g. ".cs"
|
||||
* @return true if extension is meant for C# files
|
||||
*/
|
||||
static bool isCSharp(const std::string &extensionInLowerCase);
|
||||
};
|
||||
|
||||
/// @}
|
||||
|
|
|
@ -33,8 +33,6 @@ private:
|
|||
TEST_CASE(getRelative);
|
||||
TEST_CASE(is_c);
|
||||
TEST_CASE(is_cpp);
|
||||
TEST_CASE(is_java);
|
||||
TEST_CASE(is_csharp);
|
||||
}
|
||||
|
||||
void simplify_path() const {
|
||||
|
@ -119,20 +117,6 @@ private:
|
|||
ASSERT(Path::isCPP("C:\\foo\\index.cpp"));
|
||||
ASSERT(Path::isCPP("C:\\foo\\index.Cpp"));
|
||||
}
|
||||
|
||||
void is_java() const {
|
||||
ASSERT(Path::isJava("index.cpp")==false);
|
||||
ASSERT(Path::isJava("index.java"));
|
||||
ASSERT(Path::isJava("C:\\foo\\index.java"));
|
||||
ASSERT(Path::isJava("C:\\foo\\index.Java"));
|
||||
}
|
||||
|
||||
void is_csharp() const {
|
||||
ASSERT(Path::isCSharp("index.cpp")==false);
|
||||
ASSERT(Path::isCSharp("index.cs"));
|
||||
ASSERT(Path::isCSharp("C:\\foo\\index.cs"));
|
||||
ASSERT(Path::isCSharp("C:\\foo\\index.Cs"));
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestPath)
|
||||
|
|
Loading…
Reference in New Issue