Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a17b615

Browse files
author
Max Schaefer
committed
C++/Python: Deprecate XMLFile.getPath and XMLFile.getFolder.
Both can be expressed using predicates inherited from `File`.
1 parent 47c1fc7 commit a17b615

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

  • cpp/ql/src/semmle/code/cpp
  • python/ql/src/semmle/python/xml

cpp/ql/src/semmle/code/cpp/XML.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,19 @@ class XMLFile extends XMLParent, File {
117117
/** Gets the name of this XML file. */
118118
override string getName() { result = File.super.getAbsolutePath() }
119119

120-
/** Gets the path of this XML file. */
121-
string getPath() { result = getAbsolutePath() }
120+
/**
121+
* DEPRECATED: Use `getAbsolutePath()` instead.
122+
*
123+
* Gets the path of this XML file.
124+
*/
125+
deprecated string getPath() { result = getAbsolutePath() }
122126

123-
/** Gets the path of the folder that contains this XML file. */
124-
string getFolder() { result = getParentContainer().getAbsolutePath() }
127+
/**
128+
* DEPRECATED: Use `getParentContainer().getAbsolutePath()` instead.
129+
*
130+
* Gets the path of the folder that contains this XML file.
131+
*/
132+
deprecated string getFolder() { result = getParentContainer().getAbsolutePath() }
125133

126134
/** Gets the encoding of this XML file. */
127135
string getEncoding() { xmlEncoding(this, result) }

python/ql/src/semmle/python/xml/XML.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,19 @@ class XMLFile extends XMLParent, File {
117117
/** Gets the name of this XML file. */
118118
override string getName() { result = File.super.getAbsolutePath() }
119119

120-
/** Gets the path of this XML file. */
121-
string getPath() { result = getAbsolutePath() }
120+
/**
121+
* DEPRECATED: Use `getAbsolutePath()` instead.
122+
*
123+
* Gets the path of this XML file.
124+
*/
125+
deprecated string getPath() { result = getAbsolutePath() }
122126

123-
/** Gets the path of the folder that contains this XML file. */
124-
string getFolder() { result = getParentContainer().getAbsolutePath() }
127+
/**
128+
* DEPRECATED: Use `getParentContainer().getAbsolutePath()` instead.
129+
*
130+
* Gets the path of the folder that contains this XML file.
131+
*/
132+
deprecated string getFolder() { result = getParentContainer().getAbsolutePath() }
125133

126134
/** Gets the encoding of this XML file. */
127135
string getEncoding() { xmlEncoding(this, result) }

0 commit comments

Comments
 (0)