Comments (6)
What's wrong with Application::options() ?
from poco.
Not sure I understand. I want the value of argv[] that was passed to main()... even if it's converted into a std::vectorstd::string instead.
options() doesn't provide this.
from poco.
I want the value of argv[] that was passed to main()
Use Application::config():
config().getInt("application.argc");
config().getString("application.argv[n]");
from poco.
That's what I do, but I'm suggesting that if (a) we didn't blow away _args in processOptions() and (b) provided a const accessor to it, that might be a lot simpler.
What happens if the internal organization of the code changes and instead of being keyed as "application.argc" it gets keyed by some other name?
There's a setArgs() method. Good object design suggests that a corresponding getter-method would be appropriate.
from poco.
That's what I do, but I'm suggesting that if (a) we didn't blow away _args in processOptions() and (b) provided a const accessor to it, that might be a lot simpler.
After initialization, the _args vector only contains parameters that were not processed by processOptions(). Changing semantics to leave _args vector intact after processing options would break existing code that relies on it.
What happens if the internal organization of the code changes and instead of being keyed as "application.argc" it gets keyed by some other name?
One could ask the same question for anything, including the above description of how code would break if we do what is asked for here. We break existing code only if we decide that benefits outweigh the pain incurred. I do not foresee "aplication.argc" to change unless ANSI C and existing widespread code naming conventions suddenly change.
There's a setArgs() method. Good object design suggests that a corresponding getter-method would be appropriate.
setArgs() is private so getArgs() availability does not follow from its existence.
The only option is to have another vector that retains all arguments but that won't happen in 1.5.1. There is an easy, reasonable and consistent workaround for what you are trying to achieve.
from poco.
added in develop for 1.5.1:
from poco.
Related Issues (20)
- Poco::BasicMemoryStreamBuf is missing seekpos()
- PocoDoc: search support
- websockets server: 401 unauthorized
- Upgrade bundled libexpat to 2.6.2
- Poco::Optional iterator to enable "for-each" syntax HOT 2
- Couldn't establish an encrypted FTP data connection with FTP(S)ClientSession HOT 2
- Optional and Nullable Improvements HOT 1
- GitHub runner: Linux thread sanitizer tests fail with "unexpected memory mapping"
- ODBC Unicode wrappers do not check for null length pointers
- On Poco::Buffer<char> deallocation, free(): invalid next size (normal) HOT 2
- FAILED: bin/libPocoActiveRecord.dll lib/libPocoActiveRecord.dll.a HOT 1
- Upgrade bundled SQLite to 3.45.2
- HTTP cookie specification update HOT 2
- why ini file don't support write, is it difficult? HOT 1
- Checksum mismatch for release 1.13.3 HOT 6
- Issue with Websocket+TLS in Poco 1.13.3 HOT 7
- RecordSet issue since 1.10.0
- SocketStream messages doesn't send, and send after close socket.
- SQLChannel stops logging on LoggingSubsystem shutdown HOT 1
- Build Error in gcc 8 with POCO 1.13.0 Release. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poco.