예제 #1
0
        public static MutableString ToJson(RubyContext context, IList self, GeneratorState state, int? depth)
        {
            MutableString result;

            if (state == null) {
                result = MutableString.CreateMutable(2 + Math.Max(self.Count * 4, 0), RubyEncoding.UTF8);
                result.Append('[');
                context.TaintObjectBy<Object>(result, self);
                if (self.Count > 0) {
                    for (int i = 0; i < self.Count; i++) {
                        Object element = self[i];
                        result.Append(Generator.ToJson(context, element, null, 0));
                        context.TaintObjectBy<Object>(result, element);
                        if (i < self.Count - 1) {
                            result.Append(',');
                        }
                    }
                }
                result.Append(']');
            }
            else {
                result = Transform(context, self, state, depth.HasValue ? depth.Value : 0);
            }

            return context.TaintObjectBy<MutableString>(result, self);
        }
예제 #2
0
        public static MutableString ToJson(RubyContext context, IList self, GeneratorState state, int?depth)
        {
            MutableString result;

            if (state == null)
            {
                result = MutableString.CreateMutable(2 + Math.Max(self.Count * 4, 0), RubyEncoding.UTF8);
                result.Append('[');
                context.TaintObjectBy <Object>(result, self);
                if (self.Count > 0)
                {
                    for (int i = 0; i < self.Count; i++)
                    {
                        Object element = self[i];
                        result.Append(Generator.ToJson(context, element, null, 0));
                        context.TaintObjectBy <Object>(result, element);
                        if (i < self.Count - 1)
                        {
                            result.Append(',');
                        }
                    }
                }
                result.Append(']');
            }
            else
            {
                result = Transform(context, self, state, depth.HasValue ? depth.Value : 0);
            }

            return(context.TaintObjectBy <MutableString>(result, self));
        }
 public static GeneratorState Reinitialize(RubyContext context, GeneratorState self, Hash configuration)
 {
     if (configuration != null)
     {
         GeneratorState.Configure(context, self, configuration);
     }
     return(self);
 }
예제 #4
0
 public static GeneratorState CreateGeneratorState(RubyClass/*!*/ self, [Optional]Hash configuration)
 {
     GeneratorState state = new GeneratorState();
     if (configuration != null) {
         Reinitialize(self.Context, state, configuration);
     }
     return state;
 }
예제 #5
0
        public static MutableString ToJson(ConversionStorage <MutableString> toS, IDictionary self, GeneratorState state, int?depth)
        {
            MutableString result;
            RubyContext   context = toS.Context;

            if (state == null)
            {
                MutableString json;
                result = MutableString.CreateMutable(2 + Math.Max(self.Count * 12, 0), RubyEncoding.Default);

                result.Append('{');
                if (self.Count > 0)
                {
                    int i = 0;
                    foreach (DictionaryEntry kv in self)
                    {
                        // TODO: added state and depth
                        json = Generator.ToJson(context, Protocols.ConvertToString(toS, kv.Key), null, 0);
                        result.Append(json);
                        context.TaintObjectBy <Object>(result, json);

                        result.Append(':');

                        json = Generator.ToJson(context, kv.Value, null, 0);
                        result.Append(json);
                        context.TaintObjectBy <Object>(result, json);

                        if (++i < self.Count)
                        {
                            result.Append(',');
                        }
                    }
                }
                result.Append('}');
            }
            else
            {
                GeneratorState.Ensure(state);
                if (state.CheckCircular)
                {
                    if (state.Seen(context, self))
                    {
                        Helpers.ThrowCircularDataStructureException("circular data structures not supported!");
                    }
                    state.Remember(context, self);
                    result = Transform(toS, self, state, depth.HasValue ? depth.Value : 0);
                    state.Forget(context, self);
                }
                else
                {
                    result = Transform(toS, self, state, depth.HasValue ? depth.Value : 0);
                }
            }

            return(result);
        }
        public static GeneratorState /*!*/ CreateGeneratorState(RubyClass /*!*/ self, [Optional] Hash configuration)
        {
            GeneratorState state = new GeneratorState();

            if (configuration != null)
            {
                Reinitialize(self.Context, state, configuration);
            }
            return(state);
        }
예제 #7
0
        private static MutableString Transform(ConversionStorage<MutableString> toS, IDictionary self, GeneratorState state, int depth)
        {
            byte[] objectNl = state.ObjectNl.ToByteArray();
            byte[] indent = Helpers.Repeat(state.Indent.ToByteArray(), depth + 1);
            byte[] spaceBefore = state.SpaceBefore.ToByteArray();
            byte[] space = state.Space.ToByteArray();
            int subDepth = depth + 1;

            MutableString result = MutableString.CreateBinary(2 + self.Count * (12 + indent.Length + spaceBefore.Length + space.Length));
            RubyContext context = toS.Context;

            result.Append((byte)'{');
            result.Append(objectNl);
            if (self.Count > 0) {
                MutableString json;
                int i = 0;
                foreach (DictionaryEntry kv in self) {
                    if (i > 0) {
                        result.Append(objectNl);
                    }
                    if (objectNl.Length != 0) {
                        result.Append(indent);
                    }

                    json = Generator.ToJson(context, Protocols.ConvertToString(toS, kv.Key), state, subDepth);
                    result.Append(json);
                    context.TaintObjectBy<Object>(result, json);

                    result.Append(spaceBefore);
                    result.Append((byte)':');
                    result.Append(space);

                    json = Generator.ToJson(context, kv.Value, state, subDepth);
                    result.Append(json);
                    context.TaintObjectBy<Object>(result, json);

                    if (++i < self.Count) {
                        result.Append(',');
                    }
                }

                if (objectNl.Length != 0) {
                    result.Append(objectNl);
                    if (indent.Length != 0) {
                        for (int n = 0; n < depth; n++) {
                            result.Append(indent);
                        }
                    }
                }
            }
            result.Append((byte)'}');
            return result;
        }
예제 #8
0
 public static MutableString ToJson(Double self, GeneratorState state)
 {
     if (Double.IsInfinity(self) || Double.IsNaN(self)) {
         if (state != null && state.AllowNaN == false) {
             Helpers.ThrowGenerateException(String.Format("{0} not allowed in JSON", self));
         }
         return MutableString.CreateAscii(self.ToString(NumberFormatInfo.InvariantInfo));
     }
     else {
         return MutableString.CreateAscii(self.ToString(NumberFormatInfo.InvariantInfo));
     }
 }
        public static Hash ToHash(RubyContext /*!*/ context, GeneratorState /*!*/ self)
        {
            // TODO: vOpts.respondsTo("to_hash")
            Hash configurationHash = new Hash(context);

            configurationHash.Add(Helpers.GetGeneratorStateKey(context, "indent"), self.Indent);
            configurationHash.Add(Helpers.GetGeneratorStateKey(context, "space"), self.Space);
            configurationHash.Add(Helpers.GetGeneratorStateKey(context, "space_before"), self.SpaceBefore);
            configurationHash.Add(Helpers.GetGeneratorStateKey(context, "object_nl"), self.ObjectNl);
            configurationHash.Add(Helpers.GetGeneratorStateKey(context, "array_nl"), self.ArrayNl);
            configurationHash.Add(Helpers.GetGeneratorStateKey(context, "check_circular"), self.CheckCircular);
            configurationHash.Add(Helpers.GetGeneratorStateKey(context, "allow_nan"), self.AllowNaN);
            configurationHash.Add(Helpers.GetGeneratorStateKey(context, "max_nesting"), self.MaxNesting);
            return(configurationHash);
        }
예제 #10
0
 public static MutableString ToJson(Double self, GeneratorState state)
 {
     if (Double.IsInfinity(self) || Double.IsNaN(self))
     {
         if (state != null && state.AllowNaN == false)
         {
             Helpers.ThrowGenerateException(String.Format("{0} not allowed in JSON", self));
         }
         return(MutableString.CreateAscii(self.ToString(NumberFormatInfo.InvariantInfo)));
     }
     else
     {
         return(MutableString.CreateAscii(self.ToString(NumberFormatInfo.InvariantInfo)));
     }
 }
예제 #11
0
        public static MutableString ToJson(ConversionStorage<MutableString> toS, IDictionary self, GeneratorState state, int? depth)
        {
            MutableString result;
            RubyContext context = toS.Context;

            if (state == null) {
                MutableString json;
                result = MutableString.CreateMutable(2 + Math.Max(self.Count * 12, 0), RubyEncoding.Default);

                result.Append('{');
                if (self.Count > 0) {
                    int i = 0;
                    foreach (DictionaryEntry kv in self) {
                        // TODO: added state and depth
                        json = Generator.ToJson(context, Protocols.ConvertToString(toS, kv.Key), null, 0);
                        result.Append(json);
                        context.TaintObjectBy<Object>(result, json);

                        result.Append(':');

                        json = Generator.ToJson(context, kv.Value, null, 0);
                        result.Append(json);
                        context.TaintObjectBy<Object>(result, json);

                        if (++i < self.Count) {
                            result.Append(',');
                        }
                    }
                }
                result.Append('}');
            }
            else {
                GeneratorState.Ensure(state);
                if (state.CheckCircular) {
                    if (state.Seen(context, self)) {
                        Helpers.ThrowCircularDataStructureException("circular data structures not supported!");
                    }
                    state.Remember(context, self);
                    result = Transform(toS, self, state, depth.HasValue ? depth.Value : 0);
                    state.Forget(context, self);
                }
                else {
                    result = Transform(toS, self, state, depth.HasValue ? depth.Value : 0);
                }
            }

            return result;
        }
예제 #12
0
 public static void Configure(RubyContext /*!*/ context, GeneratorState /*!*/ self, Hash /*!*/ configuration)
 {
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "indent")))
     {
         self.Indent = configuration[Helpers.GetGeneratorStateKey(context, "indent")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "space")))
     {
         self.Space = configuration[Helpers.GetGeneratorStateKey(context, "space")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "space_before")))
     {
         self.SpaceBefore = configuration[Helpers.GetGeneratorStateKey(context, "space_before")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "array_nl")))
     {
         self.ArrayNl = configuration[Helpers.GetGeneratorStateKey(context, "array_nl")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "object_nl")))
     {
         self.ObjectNl = configuration[Helpers.GetGeneratorStateKey(context, "object_nl")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "check_circular")))
     {
         Object cc = configuration[Helpers.GetGeneratorStateKey(context, "check_circular")];
         self.CheckCircular = cc is bool?(bool)cc : false;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "max_nesting")))
     {
         Object mn = configuration[Helpers.GetGeneratorStateKey(context, "max_nesting")];
         self.MaxNesting = (mn is int) ? (int)mn : 0;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "allow_nan")))
     {
         Object an = configuration[Helpers.GetGeneratorStateKey(context, "allow_nan")];
         self.AllowNaN = an is bool?(bool)an : false;
     }
 }
예제 #13
0
 public static Int32 GetMaxNesting(GeneratorState self)
 {
     return self.MaxNesting;
 }
예제 #14
0
 public static Boolean GetCheckCircular(GeneratorState self)
 {
     return self.CheckCircular;
 }
예제 #15
0
 public static Object ASeen(RubyContext context, GeneratorState self, Object obj)
 {
     return self.Seen(context, obj) ? true : null as Object;
 }
예제 #16
0
 public static Hash ToHash(RubyContext/*!*/ context, GeneratorState/*!*/ self)
 {
     // TODO: vOpts.respondsTo("to_hash")
     Hash configurationHash = new Hash(context);
     configurationHash.Add(Helpers.GetGeneratorStateKey(context, "indent"), self.Indent);
     configurationHash.Add(Helpers.GetGeneratorStateKey(context, "space"), self.Space);
     configurationHash.Add(Helpers.GetGeneratorStateKey(context, "space_before"), self.SpaceBefore);
     configurationHash.Add(Helpers.GetGeneratorStateKey(context, "object_nl"), self.ObjectNl);
     configurationHash.Add(Helpers.GetGeneratorStateKey(context, "array_nl"), self.ArrayNl);
     configurationHash.Add(Helpers.GetGeneratorStateKey(context, "check_circular"), self.CheckCircular);
     configurationHash.Add(Helpers.GetGeneratorStateKey(context, "allow_nan"), self.AllowNaN);
     configurationHash.Add(Helpers.GetGeneratorStateKey(context, "max_nesting"), self.MaxNesting);
     return configurationHash;
 }
예제 #17
0
 public static void SetObjectNl(GeneratorState self, MutableString value)
 {
     self.ObjectNl = value;
 }
예제 #18
0
 public static void SetIndent(GeneratorState self, MutableString value)
 {
     self.Indent = value;
 }
예제 #19
0
        private static MutableString Transform(RubyContext context, IList self, GeneratorState state, int depth)
        {
            MutableString result = MutableString.CreateMutable(2 + Math.Max(self.Count * 4, 0), RubyEncoding.UTF8);

            byte[] indentUnit = state.Indent.ToByteArray();
            byte[] shift      = Helpers.Repeat(indentUnit, depth + 1);
            byte[] arrayNl    = state.ArrayNl.ToByteArray();
            byte[] delim      = new byte[1 + arrayNl.Length];
            delim[0] = (byte)',';
            Array.Copy(arrayNl, 0, delim, 1, arrayNl.Length);

            state.CheckMaxNesting(depth + 1);
            context.TaintObjectBy <Object>(result, self);

            if (state.CheckCircular)
            {
                state.Remember(context, self);
                result.Append('[');
                result.Append(arrayNl);
                if (self.Count > 0)
                {
                    for (int i = 0; i < self.Count; i++)
                    {
                        Object element = self[i];
                        if (state.Seen(context, element))
                        {
                            Helpers.ThrowCircularDataStructureException("circular data structures not supported!");
                        }
                        context.TaintObjectBy <Object>(result, element);
                        if (i > 0)
                        {
                            result.Append(delim);
                        }
                        result.Append(shift);
                        result.Append(Generator.ToJson(context, element, state, depth + 1));
                    }

                    // TODO: this might be needed outside of the count check for compat
                    if (arrayNl.Length != 0)
                    {
                        result.Append(arrayNl);
                        result.Append(shift, 0, depth * indentUnit.Length);
                    }
                }
                result.Append(']');
                state.Forget(context, self);
            }
            else
            {
                result.Append('[');
                result.Append(arrayNl);
                if (self.Count > 0)
                {
                    for (int i = 0; i < self.Count; i++)
                    {
                        Object element = self[i];
                        context.TaintObjectBy <Object>(result, element);
                        if (i > 0)
                        {
                            result.Append(delim);
                        }
                        result.Append(shift);
                        result.Append(Generator.ToJson(context, element, state, depth + 1));
                    }

                    // TODO: this might be needed outside of the count check for compatibility
                    if (arrayNl.Length != 0)
                    {
                        result.Append(arrayNl);
                        result.Append(shift, 0, depth * indentUnit.Length);
                    }
                }
                result.Append(']');
            }

            return(result);
        }
예제 #20
0
 public static void SetMaxNesting(GeneratorState self, Int32 value)
 {
     self.MaxNesting = value;
 }
예제 #21
0
 public static Int32 GetMaxNesting(GeneratorState self)
 {
     return(self.MaxNesting);
 }
예제 #22
0
 public static void SetIndent(GeneratorState self, MutableString value)
 {
     self.Indent = value;
 }
예제 #23
0
 public static Boolean GetCheckCircular(GeneratorState self)
 {
     return(self.CheckCircular);
 }
예제 #24
0
 public static void SetArrayNl(GeneratorState self, MutableString value)
 {
     self.ArrayNl = value;
 }
예제 #25
0
 public static MutableString GetArrayNl(GeneratorState self)
 {
     return(self.ObjectNl);
 }
예제 #26
0
 public static void SetObjectNl(GeneratorState self, MutableString value)
 {
     self.ObjectNl = value;
 }
예제 #27
0
 public static MutableString GetSpace(GeneratorState self)
 {
     return self.Space;
 }
예제 #28
0
        private static MutableString Transform(RubyContext context, IList self, GeneratorState state, int depth)
        {
            MutableString result = MutableString.CreateMutable(2 + Math.Max(self.Count * 4, 0), RubyEncoding.UTF8);

            byte[] indentUnit = state.Indent.ToByteArray();
            byte[] shift = Helpers.Repeat(indentUnit, depth + 1);
            byte[] arrayNl = state.ArrayNl.ToByteArray();
            byte[] delim = new byte[1 + arrayNl.Length];
            delim[0] = (byte)',';
            Array.Copy(arrayNl, 0, delim, 1, arrayNl.Length);

            state.CheckMaxNesting(depth + 1);
            context.TaintObjectBy<Object>(result, self);

            if (state.CheckCircular) {
                state.Remember(context, self);
                result.Append('[');
                result.Append(arrayNl);
                if (self.Count > 0) {
                    for (int i = 0; i < self.Count; i++) {
                        Object element = self[i];
                        if (state.Seen(context, element)) {
                            Helpers.ThrowCircularDataStructureException("circular data structures not supported!");
                        }
                        context.TaintObjectBy<Object>(result, element);
                        if (i > 0) {
                            result.Append(delim);
                        }
                        result.Append(shift);
                        result.Append(Generator.ToJson(context, element, state, depth + 1));
                    }

                    // TODO: this might be needed outside of the count check for compat
                    if (arrayNl.Length != 0) {
                        result.Append(arrayNl);
                        result.Append(shift, 0, depth * indentUnit.Length);
                    }
                }
                result.Append(']');
                state.Forget(context, self);
            }
            else {
                result.Append('[');
                result.Append(arrayNl);
                if (self.Count > 0) {
                    for (int i = 0; i < self.Count; i++) {
                        Object element = self[i];
                        context.TaintObjectBy<Object>(result, element);
                        if (i > 0) {
                            result.Append(delim);
                        }
                        result.Append(shift);
                        result.Append(Generator.ToJson(context, element, state, depth + 1));
                    }

                    // TODO: this might be needed outside of the count check for compatibility
                    if (arrayNl.Length != 0) {
                        result.Append(arrayNl);
                        result.Append(shift, 0, depth * indentUnit.Length);
                    }
                }
                result.Append(']');
            }

            return result;
        }
예제 #29
0
 public static MutableString ToJson(ConversionStorage <MutableString> /*!*/ toS,
                                    Object /*!*/ self, [Optional] GeneratorState state, [Optional] Int32 depth)
 {
     return(Generator.ToJson(Protocols.ConvertToString(toS, self)));
 }
예제 #30
0
 public static void SetSpaceBefore(GeneratorState self, MutableString value)
 {
     self.SpaceBefore = value;
 }
예제 #31
0
 public static GeneratorState Reconfigure(RubyContext context, GeneratorState /*!*/ self, Hash /*!*/ configuration)
 {
     GeneratorState.Configure(context, self, configuration);
     return(self);
 }
예제 #32
0
 public static void SetMaxNesting(GeneratorState self, Int32 value)
 {
     self.MaxNesting = value;
 }
예제 #33
0
        private static MutableString Transform(ConversionStorage <MutableString> toS, IDictionary self, GeneratorState state, int depth)
        {
            byte[] objectNl    = state.ObjectNl.ToByteArray();
            byte[] indent      = Helpers.Repeat(state.Indent.ToByteArray(), depth + 1);
            byte[] spaceBefore = state.SpaceBefore.ToByteArray();
            byte[] space       = state.Space.ToByteArray();
            int    subDepth    = depth + 1;

            MutableString result  = MutableString.CreateBinary(2 + self.Count * (12 + indent.Length + spaceBefore.Length + space.Length));
            RubyContext   context = toS.Context;

            result.Append((byte)'{');
            result.Append(objectNl);
            if (self.Count > 0)
            {
                MutableString json;
                int           i = 0;
                foreach (DictionaryEntry kv in self)
                {
                    if (i > 0)
                    {
                        result.Append(objectNl);
                    }
                    if (objectNl.Length != 0)
                    {
                        result.Append(indent);
                    }

                    json = Generator.ToJson(context, Protocols.ConvertToString(toS, kv.Key), state, subDepth);
                    result.Append(json);
                    context.TaintObjectBy <Object>(result, json);

                    result.Append(spaceBefore);
                    result.Append((byte)':');
                    result.Append(space);

                    json = Generator.ToJson(context, kv.Value, state, subDepth);
                    result.Append(json);
                    context.TaintObjectBy <Object>(result, json);

                    if (++i < self.Count)
                    {
                        result.Append(',');
                    }
                }

                if (objectNl.Length != 0)
                {
                    result.Append(objectNl);
                    if (indent.Length != 0)
                    {
                        for (int n = 0; n < depth; n++)
                        {
                            result.Append(indent);
                        }
                    }
                }
            }
            result.Append((byte)'}');
            return(result);
        }
예제 #34
0
 public static void SetSpaceBefore(GeneratorState self, MutableString value)
 {
     self.SpaceBefore = value;
 }
예제 #35
0
 public static bool ARemember(RubyContext context, GeneratorState self, Object obj)
 {
     self.Remember(context, obj);
     return(true);
 }
예제 #36
0
 public static bool ARemember(RubyContext context, GeneratorState self, Object obj)
 {
     self.Remember(context, obj);
     return true;
 }
예제 #37
0
 public static MutableString ToJson(ConversionStorage <MutableString> toS, Hash self,
                                    [Optional] GeneratorState state, [Optional] Int32 depth)
 {
     return(Generator.ToJson(toS, self, state, depth));
 }
예제 #38
0
 public static void Configure(RubyContext/*!*/ context, GeneratorState/*!*/ self, Hash/*!*/ configuration)
 {
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "indent"))) {
         self.Indent = configuration[Helpers.GetGeneratorStateKey(context, "indent")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "space"))) {
         self.Space = configuration[Helpers.GetGeneratorStateKey(context, "space")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "space_before"))) {
         self.SpaceBefore = configuration[Helpers.GetGeneratorStateKey(context, "space_before")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "array_nl"))) {
         self.ArrayNl = configuration[Helpers.GetGeneratorStateKey(context, "array_nl")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "object_nl"))) {
         self.ObjectNl = configuration[Helpers.GetGeneratorStateKey(context, "object_nl")] as MutableString;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "check_circular"))) {
         Object cc = configuration[Helpers.GetGeneratorStateKey(context, "check_circular")];
         self.CheckCircular = cc is bool ? (bool)cc : false;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "max_nesting"))) {
         Object mn = configuration[Helpers.GetGeneratorStateKey(context, "max_nesting")];
         self.MaxNesting = (mn is int) ? (int)mn : 0;
     }
     if (configuration.ContainsKey(Helpers.GetGeneratorStateKey(context, "allow_nan"))) {
         Object an = configuration[Helpers.GetGeneratorStateKey(context, "allow_nan")];
         self.AllowNaN = an is bool ? (bool)an : false;
     }
 }
예제 #39
0
 public static MutableString GetIndent(GeneratorState self)
 {
     return(self.Indent);
 }
예제 #40
0
 public static MutableString GetIndent(GeneratorState self)
 {
     return self.Indent;
 }
예제 #41
0
 public static MutableString ToJson(String self, [Optional] GeneratorState state, [Optional] Int32 depth)
 {
     return(Generator.ToJson(MutableString.Create(self, RubyEncoding.Binary)));
 }
예제 #42
0
 public static MutableString GetObjectNl(GeneratorState self)
 {
     return self.ObjectNl;
 }
예제 #43
0
 public static MutableString ToJson(Boolean self, [Optional] GeneratorState state, [Optional] Int32 depth)
 {
     return(Generator.ToJson(self));
 }
예제 #44
0
 public static GeneratorState Reconfigure(RubyContext context, GeneratorState/*!*/ self, Hash/*!*/ configuration)
 {
     GeneratorState.Configure(context, self, configuration);
     return self;
 }
예제 #45
0
 public static GeneratorState Reinitialize(RubyContext context, GeneratorState self, Hash configuration)
 {
     if (configuration != null) {
         GeneratorState.Configure(context, self, configuration);
     }
     return self;
 }
예제 #46
0
 public static MutableString ToJson(RubyContext /*!*/ context, RubyArray self,
                                    [Optional] GeneratorState state, [Optional] Int32 depth)
 {
     return(Generator.ToJson(context, self, state, depth));
 }
예제 #47
0
 public static void SetArrayNl(GeneratorState self, MutableString value)
 {
     self.ArrayNl = value;
 }
예제 #48
0
 public static Object ASeen(RubyContext context, GeneratorState self, Object obj)
 {
     return(self.Seen(context, obj) ? true : null as Object);
 }
예제 #49
0
 public static MutableString GetSpaceBefore(GeneratorState self)
 {
     return(self.SpaceBefore);
 }