summaryrefslogtreecommitdiff
path: root/src/precmd.h
Commit message (Collapse)AuthorAgeFilesLines
* Use #pragma onceAlexis Hildebrandt2023-04-101-4/+1
|
* Update copyright yearAlexis Hildebrandt2023-02-021-1/+1
| | | | [skip ci]
* Update copyright statement for 2022Alexis Hildebrandt2022-07-021-1/+1
|
* Change header guard names to use `INCLUDED_` prefixPhil Newton2022-04-061-3/+3
| | | | Fixes #2049
* [misc] Update year in copyright notice to 2017Alexis Hildebrandt2018-01-271-1/+1
| | | | [ci skip]
* [misc] Update year in copyright notice to 2017Alexis Hildebrandt2017-01-051-1/+1
| | | | [ci skip]
* [misc] Update year in copyright notice to 2016Alexis Hildebrandt2016-01-021-1/+1
| | | | [ci skip]
* Bump copyright notice to 2015Alexis Hildebrandt2014-12-271-1/+1
| | | | | | The following script makes it a no-brainer: % NEXT_YEAR=2015; ag -l 'Copyright.*Wiegley' \ | xargs sed -i '' -e "s/\(Copyright.*\)-20[0-9]\{2\}/\1-${NEXT_YEAR}/"
* Bump copyright information to 2014Alexis Hildebrandt2014-02-021-1/+1
|
* Bump copyright information to 2013John Wiegley2013-02-181-1/+1
|
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Updated copyrights to 2003-2010John Wiegley2010-03-051-1/+1
|
* Renamed the "args" command to "query"John Wiegley2010-03-041-1/+1
|
* Removed a bunch of empty commentsJohn Wiegley2009-11-081-4/+0
|
* Create a new interactive_t helper classJohn Wiegley2009-02-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of this class is much like Emacs' (interactive) form: it allows a value expression function to declare exactly how many arguments, and of what type, it intends to receive. It then offers type-safe access to theese arguments in a consistent manner. An example value expression function definition in C++: value_t fn_foo(call_scope_t& scope) { // We expect a string, an integer, and an optional date interactive_t args(scope, "sl&d"); std::cout << "String = " << args.get<string>(0) << "Integer = " << args.get<long>(1) << std::endl; if (args.has(2)) // was a date provided? std::cout << "Date = " << args.get<date_t>(2) << std::endl; return NULL_VALUE; } There is also an in_context_t<T> template, which finds the context type T in the current scope hierarchy. The in_context_t then also acts as a smart pointer to reference this context object, in addition to serving the same duty as interactive_t. This combination of intent is solely for the sake of brevity. value_t fn_bar(call_scope_t& scope) { in_context_t<account_t> env(scope, "sl&d"); std::cout << "Account name = " << env->fullname() << "String arg = " << env.get<string>(0) << std::endl; return NULL_VALUE; } As you can see here, 'env' acts as a smart pointer to the required context, and an object to extract the typed arguments.
* Moved the pre-commands to their own file, and created new "args" command.John Wiegley2009-02-011-0/+61