Improved isJavaOrCSharp, isC and isCPP. Fixed isC for files with includes.
This commit is contained in:
parent
22251d50bb
commit
845e5d259a
|
@ -52,7 +52,7 @@ public:
|
||||||
bool isJavaOrCSharp() const {
|
bool isJavaOrCSharp() const {
|
||||||
if (_files.size() != 1)
|
if (_files.size() != 1)
|
||||||
return false;
|
return false;
|
||||||
const std::string::size_type pos = _files[0].rfind(".");
|
const std::string::size_type pos = _files[0].rfind('.');
|
||||||
if (pos != std::string::npos)
|
if (pos != std::string::npos)
|
||||||
return (_files[0].substr(pos) == ".java" ||
|
return (_files[0].substr(pos) == ".java" ||
|
||||||
_files[0].substr(pos) == ".cs");
|
_files[0].substr(pos) == ".cs");
|
||||||
|
@ -61,9 +61,9 @@ public:
|
||||||
|
|
||||||
/** Is the code C. Used for bailouts */
|
/** Is the code C. Used for bailouts */
|
||||||
bool isC() const {
|
bool isC() const {
|
||||||
if (_files.size() != 1)
|
if (_files.empty())
|
||||||
return false;
|
return false;
|
||||||
const std::string::size_type pos = _files[0].rfind(".");
|
const std::string::size_type pos = _files[0].rfind('.');
|
||||||
if (pos != std::string::npos)
|
if (pos != std::string::npos)
|
||||||
return (_files[0].substr(pos) == ".c") || (_files[0].substr(pos) == ".C");
|
return (_files[0].substr(pos) == ".c") || (_files[0].substr(pos) == ".C");
|
||||||
return false;
|
return false;
|
||||||
|
@ -71,7 +71,7 @@ public:
|
||||||
|
|
||||||
/** Is the code CPP. Used for bailouts */
|
/** Is the code CPP. Used for bailouts */
|
||||||
bool isCPP() const {
|
bool isCPP() const {
|
||||||
return !isJavaOrCSharp() && !isC();
|
return !isC() && !isJavaOrCSharp();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue