C++/Python: Fix XMLFile.getPath and XMLFile.getFolder.

Previously, the former returned the file's stem (that is, basename without extension), and the latter never held.
This commit is contained in:
Max Schaefer
2019-12-17 08:51:07 +00:00
parent bf30f9cdd2
commit 47c1fc7358
2 changed files with 9 additions and 13 deletions

View File

@@ -115,15 +115,13 @@ class XMLFile extends XMLParent, File {
override string toString() { result = XMLParent.super.toString() }
/** Gets the name of this XML file. */
override string getName() { files(this, result, _, _, _) }
override string getName() { result = File.super.getAbsolutePath() }
/** Gets the path of this XML file. */
string getPath() { files(this, _, result, _, _) }
string getPath() { result = getAbsolutePath() }
/** Gets the path of the folder that contains this XML file. */
string getFolder() {
result = this.getPath().substring(0, this.getPath().length() - this.getName().length())
}
string getFolder() { result = getParentContainer().getAbsolutePath() }
/** Gets the encoding of this XML file. */
string getEncoding() { xmlEncoding(this, result) }