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 {
|
||||
if (_files.size() != 1)
|
||||
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)
|
||||
return (_files[0].substr(pos) == ".java" ||
|
||||
_files[0].substr(pos) == ".cs");
|
||||
|
@ -61,9 +61,9 @@ public:
|
|||
|
||||
/** Is the code C. Used for bailouts */
|
||||
bool isC() const {
|
||||
if (_files.size() != 1)
|
||||
if (_files.empty())
|
||||
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)
|
||||
return (_files[0].substr(pos) == ".c") || (_files[0].substr(pos) == ".C");
|
||||
return false;
|
||||
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
/** Is the code CPP. Used for bailouts */
|
||||
bool isCPP() const {
|
||||
return !isJavaOrCSharp() && !isC();
|
||||
return !isC() && !isJavaOrCSharp();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue