mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 20:36:53 +01:00
HTTPSession's get_int now has a default parameter.
This commit is contained in:
parent
129a2a830d
commit
a791c8f4b8
@ -52,10 +52,16 @@ Ref<Reference> HTTPSession::get_reference(const String &key) {
|
||||
return Ref<Reference>(_data[key]);
|
||||
}
|
||||
|
||||
int HTTPSession::get_int(const String &key) {
|
||||
int HTTPSession::get_int(const String &key, const int def) {
|
||||
// don't lock here
|
||||
|
||||
return _data[key];
|
||||
Variant *v = _data.getptr(key);
|
||||
|
||||
if (!v) {
|
||||
return def;
|
||||
}
|
||||
|
||||
return *v;
|
||||
}
|
||||
|
||||
void HTTPSession::clear() {
|
||||
|
@ -16,6 +16,8 @@
|
||||
//Add an api for variants, similar to get set_meta, but rw locked.
|
||||
//Make sure it's obvious that it's not saved. Maybe set_temp_data ...
|
||||
|
||||
//Also add an RWLock
|
||||
|
||||
class HTTPSession : public Reference {
|
||||
GDCLASS(HTTPSession, Reference);
|
||||
|
||||
@ -34,7 +36,7 @@ public:
|
||||
const Variant &get_const(const String &key);
|
||||
Object *get_object(const String &key);
|
||||
Ref<Reference> get_reference(const String &key);
|
||||
int get_int(const String &key);
|
||||
int get_int(const String &key, const int def = 0);
|
||||
|
||||
void clear();
|
||||
void reset();
|
||||
|
Loading…
Reference in New Issue
Block a user