Procházet zdrojové kódy

added Application::commandPath()

aleks-f před 13 roky
rodič
revize
e60bcd413d

+ 3 - 0
Util/include/Poco/Util/Application.h

@@ -251,6 +251,9 @@ public:
 	std::string commandName() const;
 		/// Returns the command name used to invoke the application.
 
+	std::string commandPath() const;
+		/// Returns the full command path used to invoke the application.
+
 	LayeredConfiguration& config() const;
 		/// Returns the application's configuration.
 		

+ 1 - 2
Util/samples/SampleApp/src/SampleApp.cpp

@@ -160,9 +160,8 @@ protected:
 		if (!_helpRequested)
 		{
 			logger().information("Command line:");
-			const ArgVec argVec = argv();
 			std::ostringstream ostr;
-			for (ArgVec::const_iterator it = argVec.begin(); it != argVec.end(); ++it)
+			for (ArgVec::const_iterator it = argv().begin(); it != argv().end(); ++it)
 			{
 				ostr << *it << ' ';
 			}

+ 6 - 0
Util/src/Application.cpp

@@ -303,6 +303,12 @@ std::string Application::commandName() const
 }
 
 
+std::string Application::commandPath() const
+{
+	return _pConfig->getString("application.path");
+}
+
+
 void Application::stopOptionsProcessing()
 {
 	_stopOptionsProcessing = true;