From 11a0f65bae425baf09508e2d57c830f5cad69df5 Mon Sep 17 00:00:00 2001
From: gcontini <1121667+gcontini@users.noreply.github.com>
Date: 周六, 14 12月 2019 09:42:26 +0800
Subject: [PATCH] cleanup and change license generation parameters

---
 src/library/locate/LocatorStrategy.hpp |   40 +++++++++++++++++++++-------------------
 1 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/library/locate/LocatorStrategy.hpp b/src/library/locate/LocatorStrategy.hpp
index 4aabd6d..2cfc1e5 100644
--- a/src/library/locate/LocatorStrategy.hpp
+++ b/src/library/locate/LocatorStrategy.hpp
@@ -16,37 +16,39 @@
  *
  * Usage:
  * <ol>
- * <li> call licenseLocations to get a list of available locations (the returned format is defined by the class, it's usually the file name)</li>
- * <li> iterate over the returned vector and call retrieveLicense to get the content of the license</li>
+ * <li> call licenseLocations to get a list of available locations (the returned format is defined by the class, it's
+ * usually the file name)</li> <li> iterate over the returned vector and call retrieveLicense to get the content of the
+ * license</li>
  * </ol>
  */
 class LocatorStrategy {
 protected:
 	const std::string m_strategy_name;
-	inline LocatorStrategy(const std::string &strategyName) :
-			m_strategy_name(strategyName) {
-	}
+	inline LocatorStrategy(const std::string &strategyName) : m_strategy_name(strategyName) {}
+
 public:
-
-	virtual const std::string get_strategy_name() const {
-		return m_strategy_name;
-	}
-
-	virtual const std::vector<std::string> licenseLocations(
-			EventRegistry &eventRegistry) const = 0;
+	const virtual std::string get_strategy_name() const { return m_strategy_name; }
+	/**
+	 * Try to find licenses
+	 * @param eventRegistry
+	 * @return
+	 * A list of identifiers for call retrieve_license_content.
+	 */
+	const virtual std::vector<std::string> license_locations(EventRegistry &eventRegistry) = 0;
 
 	/**
 	 * Default implementation is to retrieve the license from file.
 	 * Subclasses may override it.
-	 * @param licenseLocation
+	 * @param licenseLocationId
+	 * 	String that identifies the license. It is usually the file name
+	 * 	but can be whatever is understood by the class
 	 * @return
+	 * 	a string containing the license data in INI format.
 	 */
-	virtual const std::string retrieveLicense(
-			const std::string &licenseLocation) const;
-	inline virtual ~LocatorStrategy() {
-	}
+	const virtual std::string retrieve_license_content(const std::string &licenseLocationId) const;
+	inline virtual ~LocatorStrategy() {}
 };
 
-}
-}
+}  // namespace locate
+}  // namespace license
 #endif

--
Gitblit v1.9.1