From 2241350d321e4ac86c4dbb1cb153e85687569198 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Wed, 7 Jun 2023 22:35:11 +0200 Subject: [PATCH] wait with deprecating Container::getURL() --- cpp/ql/lib/semmle/code/cpp/File.qll | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/File.qll b/cpp/ql/lib/semmle/code/cpp/File.qll index bac9b66965e..b2e4e0a41a5 100644 --- a/cpp/ql/lib/semmle/code/cpp/File.qll +++ b/cpp/ql/lib/semmle/code/cpp/File.qll @@ -34,6 +34,14 @@ class Container extends Locatable, @container { */ string getAbsolutePath() { none() } // overridden by subclasses + /** + * DEPRECATED: Use `getLocation` instead. + * Gets a URL representing the location of this container. + * + * For more information see [Providing URLs](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/#providing-urls). + */ + deprecated string getURL() { none() } // overridden by subclasses + /** * Gets the relative path of this file or folder from the root folder of the * analyzed source location. The relative path of the root folder itself is @@ -175,6 +183,12 @@ class Folder extends Container, @folder { } override string getAPrimaryQlClass() { result = "Folder" } + + /** + * DEPRECATED: Use `getLocation` instead. + * Gets the URL of this folder. + */ + deprecated override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" } } /** @@ -199,6 +213,12 @@ class File extends Container, @file { result.hasLocationInfo(_, 0, 0, 0, 0) } + /** + * DEPRECATED: Use `getLocation` instead. + * Gets the URL of this file. + */ + deprecated override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" } + /** Holds if this file was compiled as C (at any point). */ predicate compiledAsC() { fileannotations(underlyingElement(this), 1, "compiled as c", "1") }