Sha256: f2cdc93d62fe73d07a74240a6a00b7a8fdd418cbbff525dde0f1764193004de5

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

//
//  refract/SerializeVisitor.h
//  librefract
//
//  Created by Jiri Kratochvil on 21/05/15.
//  Copyright (c) 2015 Apiary Inc. All rights reserved.
//
#ifndef REFRACT_SERIALIZEVISITOR_H
#define REFRACT_SERIALIZEVISITOR_H

#include "sos.h"
#include <string>

#include "ElementFwd.h"

namespace refract
{

    class SosSerializeVisitor
    {

        sos::Object result;
        sos::Base partial;
        std::string key;
        bool generateSourceMap;


        static void SetSerializerValue(SosSerializeVisitor& s, sos::Base& value);

     public:

        SosSerializeVisitor(bool generateSourceMap) : partial(sos::Null()), generateSourceMap(generateSourceMap) {}

        void operator()(const IElement& e);
        void operator()(const NullElement& e);
        void operator()(const StringElement& e);
        void operator()(const NumberElement& e);
        void operator()(const BooleanElement& e);
        void operator()(const ArrayElement& e);
        void operator()(const EnumElement& e);
        void operator()(const MemberElement& e);
        void operator()(const ObjectElement& e);
        void operator()(const ExtendElement& e);
        void operator()(const SelectElement& e);
        void operator()(const OptionElement& e);

        sos::Object get()
        {
            return result;
        }
    };

}; // namespace refract

#endif // #ifndef REFRACT_SERIALIZEVISITOR_H

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lounge_lizard-0.1.4 ext/drafter/src/refract/SerializeVisitor.h
lounge_lizard-0.1.3 ext/drafter/src/refract/SerializeVisitor.h
lounge_lizard-0.1.2 ext/drafter/src/refract/SerializeVisitor.h
lounge_lizard-0.1.1 ext/drafter/src/refract/SerializeVisitor.h
lounge_lizard-0.1.0 ext/drafter/src/refract/SerializeVisitor.h