Inheritance: RubyCallSiteStorage
Exemple #1
0
        public static object QuickEmit(YamlCallSiteStorage /*!*/ siteStorage, [NotNull] BlockParam /*!*/ block, RubyModule /*!*/ self, object objectId, [NotNull] Hash /*!*/ opts)
        {
            // TODO: load from opts
            YamlOptions cfg = YamlOptions.DefaultOptions;

            MutableStringWriter writer = new MutableStringWriter(MutableString.CreateMutable(RubyEncoding.Binary));
            Serializer          s      = new Serializer(writer, cfg);
            RubyRepresenter     rep    = new RubyRepresenter(siteStorage);
            object result;

            if (block.Yield(new Syck.Out(rep), out result))
            {
                return(result);
            }

            s.Serialize(rep.ToNode(result));
            s.Close();

            return(writer.String);
        }
Exemple #2
0
 public static object DumpAll(YamlCallSiteStorage/*!*/ siteStorage, RubyModule/*!*/ self, [NotNull]IList/*!*/ objs, [Optional]RubyIO io) {
     return DumpAll(siteStorage, objs, io);
 }
Exemple #3
0
 public static object Dump(YamlCallSiteStorage/*!*/ siteStorage, RubyModule/*!*/ self, object obj, [Optional]RubyIO io) {
     return DumpAll(siteStorage, new object[] { obj }, io);
 }
 public static object ToYaml(YamlCallSiteStorage /*!*/ siteStorage, object self, [DefaultParameterValue(null)] object options)
 {
     return(RubyYaml.DumpAll(siteStorage, new object[] { self }, null));
 }
Exemple #5
0
 internal RubyRepresenter(YamlCallSiteStorage/*!*/ siteStorage)
 {
     _siteStorage = siteStorage;
 }
Exemple #6
0
 public static object Emit(YamlCallSiteStorage /*!*/ siteStorage, YamlStream /*!*/ self, [Optional] RubyIO io)
 {
     return(RubyYaml.DumpAll(siteStorage, self._documents, io));
 }
Exemple #7
0
 public static object DumpAll(YamlCallSiteStorage /*!*/ siteStorage, RubyModule /*!*/ self, [NotNull] IList /*!*/ objs, [Optional] RubyIO io)
 {
     return(DumpAll(siteStorage, objs, io));
 }
Exemple #8
0
 public static RubyRepresenter/*!*/ CreateEmitter(YamlCallSiteStorage/*!*/ siteStorage, RubyModule/*!*/ self) {
     return new RubyRepresenter(siteStorage);
 }
Exemple #9
0
                public static void Add(YamlCallSiteStorage /*!*/ siteStorage, SequenceNode /*!*/ self, object value)
                {
                    RubyRepresenter rep = new RubyRepresenter(siteStorage);

                    self.Nodes.Add(rep.RepresentItem(value));
                }
Exemple #10
0
                public static void Add(YamlCallSiteStorage /*!*/ siteStorage, MappingNode /*!*/ self, object key, object value)
                {
                    RubyRepresenter rep = new RubyRepresenter(siteStorage);

                    self.Nodes.Add(rep.RepresentItem(key), rep.RepresentItem(value));
                }
Exemple #11
0
 internal RubyRepresenter(YamlCallSiteStorage /*!*/ siteStorage)
 {
     _siteStorage = siteStorage;
 }
Exemple #12
0
 public static object ToYaml(YamlCallSiteStorage/*!*/ siteStorage, object self, [DefaultParameterValue(null)]object options)
 {
     return RubyYaml.DumpAll(siteStorage, new object[] { self }, null);
 }
Exemple #13
0
 public static RubyRepresenter /*!*/ CreateEmitter(YamlCallSiteStorage /*!*/ siteStorage, RubyModule /*!*/ self)
 {
     return(new RubyRepresenter(siteStorage));
 }
Exemple #14
0
 internal static object DumpAll(YamlCallSiteStorage /*!*/ siteStorage, IEnumerable /*!*/ objs, RubyIO io)
 {
     return(DumpAll(new RubyRepresenter(siteStorage), objs, io));
 }
Exemple #15
0
 internal static object DumpAll(YamlCallSiteStorage/*!*/ siteStorage, IEnumerable/*!*/ objs, RubyIO io) {
     return DumpAll(new RubyRepresenter(siteStorage), objs, io);
 }
Exemple #16
0
 public static void Add(YamlCallSiteStorage/*!*/ siteStorage, MappingNode/*!*/ self, object key, object value) {
     RubyRepresenter rep = new RubyRepresenter(siteStorage);
     self.Nodes.Add(rep.RepresentItem(key), rep.RepresentItem(value));
 }
Exemple #17
0
        public static object QuickEmit(YamlCallSiteStorage/*!*/ siteStorage, [NotNull]BlockParam/*!*/ block, RubyModule/*!*/ self, object objectId, [NotNull]Hash/*!*/ opts) {
            // TODO: load from opts
            YamlOptions cfg = YamlOptions.DefaultOptions;
            
            MutableStringWriter writer = new MutableStringWriter(MutableString.CreateMutable(RubyEncoding.Binary));
            Serializer s = new Serializer(writer, cfg);
            RubyRepresenter rep = new RubyRepresenter(siteStorage);
            object result;
            
            if (block.Yield(new Syck.Out(rep), out result)) {
                return result;
            }

            s.Serialize(rep.ToNode(result));
            s.Close();

            return writer.String;
        }
Exemple #18
0
 public static void Add(YamlCallSiteStorage/*!*/ siteStorage, SequenceNode/*!*/ self, object value) {
     RubyRepresenter rep = new RubyRepresenter(siteStorage);
     self.Nodes.Add(rep.RepresentItem(value));
 }
Exemple #19
0
 public static object Emit(YamlCallSiteStorage/*!*/ siteStorage, YamlStream/*!*/ self, [Optional]RubyIO io)
 {
     return RubyYaml.DumpAll(siteStorage, self._documents, io);
 }
Exemple #20
0
 public static object Dump(YamlCallSiteStorage /*!*/ siteStorage, RubyModule /*!*/ self, object obj, [Optional] RubyIO io)
 {
     return(DumpAll(siteStorage, new object[] { obj }, io));
 }