Skip to content

Commit

Permalink
libcore: Getter for dictionaries using RecordAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Dec 10, 2015
1 parent 799135e commit 3e40f49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doomsday/sdk/libcore/include/de/data/recordaccessor.h
Expand Up @@ -25,6 +25,7 @@ namespace de {

class Record;
class RecordValue;
class DictionaryValue;

/**
* Utility class with convenient get*() methods. While Record is designed to be used
Expand Down Expand Up @@ -65,6 +66,7 @@ class DENG2_PUBLIC RecordAccessor
String gets(String const &name) const;
String gets(String const &name, String const &defaultValue) const;
ArrayValue const &geta(String const &name) const;
DictionaryValue const &getdt(String const &name) const;
RecordValue const &getr(String const &name) const;

Record const &subrecord(String const &name) const;
Expand Down
6 changes: 6 additions & 0 deletions doomsday/sdk/libcore/src/data/recordaccessor.cpp
Expand Up @@ -18,6 +18,7 @@

#include "de/RecordAccessor"
#include "de/RecordValue"
#include "de/DictionaryValue"

namespace de {

Expand Down Expand Up @@ -119,6 +120,11 @@ ArrayValue const &RecordAccessor::geta(String const &name) const
return getAs<ArrayValue>(name);
}

DictionaryValue const &RecordAccessor::getdt(String const &name) const
{
return getAs<DictionaryValue>(name);
}

RecordValue const &RecordAccessor::getr(String const &name) const
{
return getAs<RecordValue>(name);
Expand Down

0 comments on commit 3e40f49

Please sign in to comment.