~jamesh/go-unityscopes/go-1.6-compat

« back to all changes in this revision

Viewing changes to result.cpp

  • Committer: James Henstridge
  • Date: 2016-04-14 07:52:20 UTC
  • Revision ID: james@jamesh.id.au-20160414075220-qon8ts05h3gyxqvu
Convert result.cpp uses of from_gostring().

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    delete reinterpret_cast<Result*>(res);
24
24
}
25
25
 
26
 
void *result_get_attr(_Result *res, void *attr, int *length, char **error) {
 
26
void *result_get_attr(_Result *res, StrData attr, int *length, char **error) {
27
27
    std::string json_data;
28
28
    try {
29
29
        Variant v = reinterpret_cast<Result*>(res)->value(from_gostring(attr));
35
35
    return as_bytes(json_data, length);
36
36
}
37
37
 
38
 
void result_set_attr(_Result *res, void *attr, void *json_value, char **error) {
 
38
void result_set_attr(_Result *res, StrData attr, StrData json_value, char **error) {
39
39
    try {
40
40
        Variant v = Variant::deserialize_json(from_gostring(json_value));
41
41
        (*reinterpret_cast<Result*>(res))[from_gostring(attr)] = v;