summaryrefslogtreecommitdiff
path: root/doc/JSON/Ext/Generator/State.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/JSON/Ext/Generator/State.html')
-rw-r--r--doc/JSON/Ext/Generator/State.html1204
1 files changed, 0 insertions, 1204 deletions
diff --git a/doc/JSON/Ext/Generator/State.html b/doc/JSON/Ext/Generator/State.html
deleted file mode 100644
index 39b6a88..0000000
--- a/doc/JSON/Ext/Generator/State.html
+++ /dev/null
@@ -1,1204 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-
- <title>Class: JSON::Ext::Generator::State</title>
-
- <link rel="stylesheet" href="../../../rdoc.css" type="text/css" media="screen" />
-
- <script src="../../../js/jquery.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="../../../js/thickbox-compressed.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="../../../js/quicksearch.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="../../../js/darkfish.js" type="text/javascript"
- charset="utf-8"></script>
-
-</head>
-<body class="class">
-
- <div id="metadata">
- <div id="file-metadata">
- <div id="file-list-section" class="section">
- <h3 class="section-header">In Files</h3>
- <div class="section-body">
- <ul>
-
- <li><a href="../../../ext/json/ext/generator_c.html?TB_iframe=true&amp;height=550&amp;width=785"
- class="thickbox" title="ext/json/ext/generator.c">ext/json/ext/generator.c</a></li>
-
- </ul>
- </div>
- </div>
-
-
- </div>
-
- <div id="class-metadata">
-
- <!-- Parent Class -->
-
- <div id="parent-class-section" class="section">
- <h3 class="section-header">Parent</h3>
-
- <p class="link"><a href="../../../Object.html">Object</a></p>
-
- </div>
-
-
- <!-- Namespace Contents -->
-
-
- <!-- Method Quickref -->
-
- <div id="method-list-section" class="section">
- <h3 class="section-header">Methods</h3>
- <ul class="link-list">
-
- <li><a href="#M000103">::from_state</a></li>
-
- <li><a href="#M000104">::new</a></li>
-
- <li><a href="#M000119">#allow_nan?</a></li>
-
- <li><a href="#M000114">#array_nl</a></li>
-
- <li><a href="#M000115">#array_nl=</a></li>
-
- <li><a href="#M000120">#ascii_only?</a></li>
-
- <li><a href="#M000121">#configure</a></li>
-
- <li><a href="#M000123">#generate</a></li>
-
- <li><a href="#M000105">#indent</a></li>
-
- <li><a href="#M000106">#indent=</a></li>
-
- <li><a href="#M000116">#max_nesting</a></li>
-
- <li><a href="#M000118">#max_nesting=</a></li>
-
- <li><a href="#M000111">#object_nl</a></li>
-
- <li><a href="#M000113">#object_nl=</a></li>
-
- <li><a href="#M000124">#partial_generate</a></li>
-
- <li><a href="#M000107">#space</a></li>
-
- <li><a href="#M000108">#space=</a></li>
-
- <li><a href="#M000109">#space_before</a></li>
-
- <li><a href="#M000110">#space_before=</a></li>
-
- <li><a href="#M000122">#to_h</a></li>
-
- </ul>
- </div>
-
-
- <!-- Included Modules -->
-
- </div>
-
- <div id="project-metadata">
-
-
- <div id="fileindex-section" class="section project-section">
- <h3 class="section-header">Files</h3>
- <ul>
-
- <li class="file"><a href="../../../README.html">README</a></li>
-
- </ul>
- </div>
-
-
- <div id="classindex-section" class="section project-section">
- <h3 class="section-header">Class Index
- <span class="search-toggle"><img src="../../../images/find.png"
- height="16" width="16" alt="[+]"
- title="show/hide quicksearch" /></span></h3>
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
- <fieldset>
- <legend>Quicksearch</legend>
- <input type="text" name="quicksearch" value=""
- class="quicksearch-field" />
- </fieldset>
- </form>
-
- <ul class="link-list">
-
- <li><a href="../../../JSON.html">JSON</a></li>
-
- <li><a href="../../../JSON/Editor.html">JSON::Editor</a></li>
-
- <li><a href="../../../JSON/Editor/EditMenu.html">JSON::Editor::EditMenu</a></li>
-
- <li><a href="../../../JSON/Editor/FileMenu.html">JSON::Editor::FileMenu</a></li>
-
- <li><a href="../../../JSON/Editor/Gtk.html">JSON::Editor::Gtk</a></li>
-
- <li><a href="../../../JSON/Editor/Gtk/TreeIter.html">JSON::Editor::Gtk::TreeIter</a></li>
-
- <li><a href="../../../JSON/Editor/JSONTreeView.html">JSON::Editor::JSONTreeView</a></li>
-
- <li><a href="../../../JSON/Editor/MainWindow.html">JSON::Editor::MainWindow</a></li>
-
- <li><a href="../../../JSON/Editor/MenuExtension.html">JSON::Editor::MenuExtension</a></li>
-
- <li><a href="../../../JSON/Editor/OptionsMenu.html">JSON::Editor::OptionsMenu</a></li>
-
- <li><a href="../../../JSON/Editor/PopUpMenu.html">JSON::Editor::PopUpMenu</a></li>
-
- <li><a href="../../../JSON/Ext.html">JSON::Ext</a></li>
-
- <li><a href="../../../JSON/Ext/Generator.html">JSON::Ext::Generator</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods.html">JSON::Ext::Generator::GeneratorMethods</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/Array.html">JSON::Ext::Generator::GeneratorMethods::Array</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/FalseClass.html">JSON::Ext::Generator::GeneratorMethods::FalseClass</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/Float.html">JSON::Ext::Generator::GeneratorMethods::Float</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/Hash.html">JSON::Ext::Generator::GeneratorMethods::Hash</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/Integer.html">JSON::Ext::Generator::GeneratorMethods::Integer</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/NilClass.html">JSON::Ext::Generator::GeneratorMethods::NilClass</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/Object.html">JSON::Ext::Generator::GeneratorMethods::Object</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/String.html">JSON::Ext::Generator::GeneratorMethods::String</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/String/Extend.html">JSON::Ext::Generator::GeneratorMethods::String::Extend</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/GeneratorMethods/TrueClass.html">JSON::Ext::Generator::GeneratorMethods::TrueClass</a></li>
-
- <li><a href="../../../JSON/Ext/Generator/State.html">JSON::Ext::Generator::State</a></li>
-
- <li><a href="../../../JSON/Ext/Parser.html">JSON::Ext::Parser</a></li>
-
- <li><a href="../../../JSON/GeneratorError.html">JSON::GeneratorError</a></li>
-
- <li><a href="../../../JSON/JSONError.html">JSON::JSONError</a></li>
-
- <li><a href="../../../JSON/MissingUnicodeSupport.html">JSON::MissingUnicodeSupport</a></li>
-
- <li><a href="../../../JSON/NestingError.html">JSON::NestingError</a></li>
-
- <li><a href="../../../JSON/ParserError.html">JSON::ParserError</a></li>
-
- <li><a href="../../../JSON/Pure.html">JSON::Pure</a></li>
-
- <li><a href="../../../JSON/Pure/Generator.html">JSON::Pure::Generator</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods.html">JSON::Pure::Generator::GeneratorMethods</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/Array.html">JSON::Pure::Generator::GeneratorMethods::Array</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/FalseClass.html">JSON::Pure::Generator::GeneratorMethods::FalseClass</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/Float.html">JSON::Pure::Generator::GeneratorMethods::Float</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/Hash.html">JSON::Pure::Generator::GeneratorMethods::Hash</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/Integer.html">JSON::Pure::Generator::GeneratorMethods::Integer</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/NilClass.html">JSON::Pure::Generator::GeneratorMethods::NilClass</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/Object.html">JSON::Pure::Generator::GeneratorMethods::Object</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/String.html">JSON::Pure::Generator::GeneratorMethods::String</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/String/Extend.html">JSON::Pure::Generator::GeneratorMethods::String::Extend</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/GeneratorMethods/TrueClass.html">JSON::Pure::Generator::GeneratorMethods::TrueClass</a></li>
-
- <li><a href="../../../JSON/Pure/Generator/State.html">JSON::Pure::Generator::State</a></li>
-
- <li><a href="../../../JSON/Pure/Parser.html">JSON::Pure::Parser</a></li>
-
- <li><a href="../../../Class.html">Class</a></li>
-
- <li><a href="../../../Date.html">Date</a></li>
-
- <li><a href="../../../DateTime.html">DateTime</a></li>
-
- <li><a href="../../../Enumerable.html">Enumerable</a></li>
-
- <li><a href="../../../Exception.html">Exception</a></li>
-
- <li><a href="../../../Kernel.html">Kernel</a></li>
-
- <li><a href="../../../Object.html">Object</a></li>
-
- <li><a href="../../../Range.html">Range</a></li>
-
- <li><a href="../../../Regexp.html">Regexp</a></li>
-
- <li><a href="../../../Struct.html">Struct</a></li>
-
- <li><a href="../../../Symbol.html">Symbol</a></li>
-
- <li><a href="../../../Time.html">Time</a></li>
-
- </ul>
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
- </div>
-
-
- </div>
- </div>
-
- <div id="documentation">
- <h1 class="class">JSON::Ext::Generator::State</h1>
-
- <div id="description">
-
- </div>
-
- <!-- Constants -->
-
-
- <!-- Attributes -->
-
-
- <!-- Methods -->
-
- <div id="public-class-method-details" class="method-section section">
- <h3 class="section-header">Public Class Methods</h3>
-
-
- <div id="from-state-method" class="method-detail ">
- <a name="M000103"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">from_state(opts)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-Creates a <a href="State.html">State</a> object from <em>opts</em>, which
-ought to be Hash to create a new <a href="State.html">State</a> instance
-configured by <em>opts</em>, something else to create an unconfigured
-instance. If <em>opts</em> is a <a href="State.html">State</a> object, it
-is just returned.
-</p>
-
-
-
- <div class="method-source-code"
- id="from-state-source">
-<pre>
-static VALUE cState_from_state_s(VALUE self, VALUE opts)
-{
- if (rb_obj_is_kind_of(opts, self)) {
- return opts;
- } else if (rb_obj_is_kind_of(opts, rb_cHash)) {
- return rb_funcall(self, i_new, 1, opts);
- } else {
- return rb_funcall(self, i_new, 0);
- }
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="new-method" class="method-detail ">
- <a name="M000104"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">new(opts = {})</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-Instantiates a new <a href="State.html">State</a> object, configured by
-<em>opts</em>.
-</p>
-<p>
-<em>opts</em> can have the following keys:
-</p>
-<ul>
-<li><b>indent</b>: a string used to indent levels (default: &#8217;&#8217;),
-
-</li>
-<li><b>space</b>: a string that is put after, a : or , delimiter (default:
-&#8217;&#8217;),
-
-</li>
-<li><b><a href="State.html#M000109">space_before</a></b>: a string that is put
-before a : pair delimiter (default: &#8217;&#8217;),
-
-</li>
-<li><b><a href="State.html#M000111">object_nl</a></b>: a string that is put at
-the end of a <a href="../../../JSON.html">JSON</a> object (default:
-&#8217;&#8217;),
-
-</li>
-<li><b><a href="State.html#M000114">array_nl</a></b>: a string that is put at
-the end of a <a href="../../../JSON.html">JSON</a> array (default:
-&#8217;&#8217;),
-
-</li>
-<li><b>allow_nan</b>: true if NaN, Infinity, and -Infinity should be generated,
-otherwise an exception is thrown, if these values are encountered. This
-options defaults to false.
-
-</li>
-</ul>
-
-
-
- <div class="method-source-code"
- id="new-source">
-<pre>
-static VALUE cState_initialize(int argc, VALUE *argv, VALUE self)
-{
- VALUE opts;
- GET_STATE(self);
- MEMZERO(state, JSON_Generator_State, 1);
- state-&gt;max_nesting = 19;
- rb_scan_args(argc, argv, &quot;01&quot;, &amp;opts);
- if (!NIL_P(opts)) cState_configure(self, opts);
- return self;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- </div>
-
- <div id="public-instance-method-details" class="method-section section">
- <h3 class="section-header">Public Instance Methods</h3>
-
-
- <div id="allow-nan--method" class="method-detail ">
- <a name="M000119"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">allow_nan?</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-Returns true, if NaN, Infinity, and -Infinity should be generated,
-otherwise returns false.
-</p>
-
-
-
- <div class="method-source-code"
- id="allow-nan--source">
-<pre>
-static VALUE cState_allow_nan_p(VALUE self)
-{
- GET_STATE(self);
- return state-&gt;allow_nan ? Qtrue : Qfalse;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="array-nl-method" class="method-detail ">
- <a name="M000114"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">array_nl()</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is put at the end of a line that holds a <a
-href="../../../JSON.html">JSON</a> array.
-</p>
-
-
-
- <div class="method-source-code"
- id="array-nl-source">
-<pre>
-static VALUE cState_array_nl(VALUE self)
-{
- GET_STATE(self);
- return state-&gt;array_nl ? rb_str_new2(state-&gt;array_nl) : rb_str_new2(&quot;&quot;);
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="array-nl--method" class="method-detail ">
- <a name="M000115"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">array_nl=(array_nl)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is put at the end of a line that holds a <a
-href="../../../JSON.html">JSON</a> array.
-</p>
-
-
-
- <div class="method-source-code"
- id="array-nl--source">
-<pre>
-static VALUE cState_array_nl_set(VALUE self, VALUE array_nl)
-{
- GET_STATE(self);
- Check_Type(array_nl, T_STRING);
- if (RSTRING_LEN(array_nl) == 0) {
- if (state-&gt;array_nl) {
- ruby_xfree(state-&gt;array_nl);
- state-&gt;array_nl = NULL;
- }
- } else {
- if (state-&gt;array_nl) ruby_xfree(state-&gt;array_nl);
- state-&gt;array_nl = strdup(RSTRING_PTR(array_nl));
- }
- return Qnil;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="ascii-only--method" class="method-detail ">
- <a name="M000120"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">ascii_only?</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-Returns true, if NaN, Infinity, and -Infinity should be generated,
-otherwise returns false.
-</p>
-
-
-
- <div class="method-source-code"
- id="ascii-only--source">
-<pre>
-static VALUE cState_ascii_only_p(VALUE self)
-{
- GET_STATE(self);
- return state-&gt;ascii_only ? Qtrue : Qfalse;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="configure-method" class="method-detail ">
- <a name="M000121"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">configure(opts)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-Configure this <a href="State.html">State</a> instance with the Hash
-<em>opts</em>, and return itself.
-</p>
-
-
-
- <div class="method-source-code"
- id="configure-source">
-<pre>
-static VALUE cState_configure(VALUE self, VALUE opts)
-{
- VALUE tmp;
- GET_STATE(self);
- tmp = rb_convert_type(opts, T_HASH, &quot;Hash&quot;, &quot;to_hash&quot;);
- if (NIL_P(tmp)) tmp = rb_convert_type(opts, T_HASH, &quot;Hash&quot;, &quot;to_h&quot;);
- if (NIL_P(tmp)) {
- rb_raise(rb_eArgError, &quot;opts has to be hash like or convertable into a hash&quot;);
- }
- opts = tmp;
- tmp = rb_hash_aref(opts, ID2SYM(i_indent));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state-&gt;indent = strdup(RSTRING_PTR(tmp));
- state-&gt;indent_len = strlen(state-&gt;indent);
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_space));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state-&gt;space = strdup(RSTRING_PTR(tmp));
- state-&gt;space_len = strlen(state-&gt;space);
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_space_before));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state-&gt;space_before = strdup(RSTRING_PTR(tmp));
- state-&gt;space_before_len = strlen(state-&gt;space_before);
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_array_nl));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state-&gt;array_nl = strdup(RSTRING_PTR(tmp));
- state-&gt;array_nl_len = strlen(state-&gt;array_nl);
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_object_nl));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state-&gt;object_nl = strdup(RSTRING_PTR(tmp));
- state-&gt;object_nl_len = strlen(state-&gt;object_nl);
- }
- tmp = ID2SYM(i_max_nesting);
- state-&gt;max_nesting = 19;
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- VALUE max_nesting = rb_hash_aref(opts, tmp);
- if (RTEST(max_nesting)) {
- Check_Type(max_nesting, T_FIXNUM);
- state-&gt;max_nesting = FIX2LONG(max_nesting);
- } else {
- state-&gt;max_nesting = 0;
- }
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_allow_nan));
- state-&gt;allow_nan = RTEST(tmp);
- tmp = rb_hash_aref(opts, ID2SYM(i_ascii_only));
- state-&gt;ascii_only = RTEST(tmp);
- return self;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="generate-method" class="method-detail ">
- <a name="M000123"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">generate(obj)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-Generates a valid <a href="../../../JSON.html">JSON</a> document from
-object <tt>obj</tt> and returns the result. If no valid <a
-href="../../../JSON.html">JSON</a> document can be created this method
-raises a <a href="../../GeneratorError.html">GeneratorError</a> exception.
-</p>
-
-
-
- <div class="method-source-code"
- id="generate-source">
-<pre>
-static VALUE cState_generate(VALUE self, VALUE obj)
-{
- VALUE result = cState_partial_generate(self, obj, Qnil);
- VALUE re, args[2];
- args[0] = rb_str_new2(&quot;\\A\\s*(?:\\[.*\\]|\\{.*\\})\\s*\\Z&quot;);
- args[1] = CRegexp_MULTILINE;
- re = rb_class_new_instance(2, args, rb_cRegexp);
- if (NIL_P(rb_reg_match(re, result))) {
- rb_raise(eGeneratorError, &quot;only generation of JSON objects or arrays allowed&quot;);
- }
- return result;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="indent-method" class="method-detail ">
- <a name="M000105"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">indent()</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is used to indent levels in the <a
-href="../../../JSON.html">JSON</a> text.
-</p>
-
-
-
- <div class="method-source-code"
- id="indent-source">
-<pre>
-static VALUE cState_indent(VALUE self)
-{
- GET_STATE(self);
- return state-&gt;indent ? rb_str_new2(state-&gt;indent) : rb_str_new2(&quot;&quot;);
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="indent--method" class="method-detail ">
- <a name="M000106"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">indent=(indent)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is used to indent levels in the <a
-href="../../../JSON.html">JSON</a> text.
-</p>
-
-
-
- <div class="method-source-code"
- id="indent--source">
-<pre>
-static VALUE cState_indent_set(VALUE self, VALUE indent)
-{
- GET_STATE(self);
- Check_Type(indent, T_STRING);
- if (RSTRING_LEN(indent) == 0) {
- if (state-&gt;indent) {
- ruby_xfree(state-&gt;indent);
- state-&gt;indent = NULL;
- }
- } else {
- if (state-&gt;indent) ruby_xfree(state-&gt;indent);
- state-&gt;indent = strdup(RSTRING_PTR(indent));
- }
- return Qnil;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="max-nesting-method" class="method-detail ">
- <a name="M000116"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">max_nesting</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This integer returns the maximum level of data structure nesting in the
-generated <a href="../../../JSON.html">JSON</a>, <a
-href="State.html#M000116">max_nesting</a> = 0 if no maximum is checked.
-</p>
-
-
-
- <div class="method-source-code"
- id="max-nesting-source">
-<pre>
-static VALUE cState_max_nesting(VALUE self)
-{
- GET_STATE(self);
- return LONG2FIX(state-&gt;max_nesting);
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="max-nesting--method" class="method-detail ">
- <a name="M000118"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">max_nesting=(depth)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This sets the maximum level of data structure nesting in the generated <a
-href="../../../JSON.html">JSON</a> to the integer depth, <a
-href="State.html#M000116">max_nesting</a> = 0 if no maximum should be
-checked.
-</p>
-
-
-
- <div class="method-source-code"
- id="max-nesting--source">
-<pre>
-static VALUE cState_max_nesting_set(VALUE self, VALUE depth)
-{
- GET_STATE(self);
- Check_Type(depth, T_FIXNUM);
- return state-&gt;max_nesting = FIX2LONG(depth);
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="object-nl-method" class="method-detail ">
- <a name="M000111"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">object_nl()</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is put at the end of a line that holds a <a
-href="../../../JSON.html">JSON</a> object (or Hash).
-</p>
-
-
-
- <div class="method-source-code"
- id="object-nl-source">
-<pre>
-static VALUE cState_object_nl(VALUE self)
-{
- GET_STATE(self);
- return state-&gt;object_nl ? rb_str_new2(state-&gt;object_nl) : rb_str_new2(&quot;&quot;);
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="object-nl--method" class="method-detail ">
- <a name="M000113"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">object_nl=(object_nl)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is put at the end of a line that holds a <a
-href="../../../JSON.html">JSON</a> object (or Hash).
-</p>
-
-
-
- <div class="method-source-code"
- id="object-nl--source">
-<pre>
-static VALUE cState_object_nl_set(VALUE self, VALUE object_nl)
-{
- GET_STATE(self);
- Check_Type(object_nl, T_STRING);
- if (RSTRING_LEN(object_nl) == 0) {
- if (state-&gt;object_nl) {
- ruby_xfree(state-&gt;object_nl);
- state-&gt;object_nl = NULL;
- }
- } else {
- if (state-&gt;object_nl) ruby_xfree(state-&gt;object_nl);
- state-&gt;object_nl = strdup(RSTRING_PTR(object_nl));
- }
- return Qnil;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="partial-generate-method" class="method-detail ">
- <a name="M000124"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">partial_generate(obj)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-Generates a part of a <a href="../../../JSON.html">JSON</a> document from
-object <tt>obj</tt> and returns the result.
-</p>
-
-
-
- <div class="method-source-code"
- id="partial-generate-source">
-<pre>
-static VALUE cState_partial_generate(VALUE self, VALUE obj, VALUE depth)
-{
- VALUE result;
- FBuffer *buffer = fbuffer_alloc();
- GET_STATE(self);
-
- if (state-&gt;object_delim) {
- fbuffer_clear(state-&gt;object_delim);
- } else {
- state-&gt;object_delim = fbuffer_alloc_with_length(16);
- }
- fbuffer_append_char(state-&gt;object_delim, ',');
- if (state-&gt;object_delim2) {
- fbuffer_clear(state-&gt;object_delim2);
- } else {
- state-&gt;object_delim2 = fbuffer_alloc_with_length(16);
- }
- fbuffer_append_char(state-&gt;object_delim2, ':');
- if (state-&gt;space) fbuffer_append(state-&gt;object_delim2, state-&gt;space, state-&gt;space_len);
-
- if (state-&gt;array_delim) {
- fbuffer_clear(state-&gt;array_delim);
- } else {
- state-&gt;array_delim = fbuffer_alloc_with_length(16);
- }
- fbuffer_append_char(state-&gt;array_delim, ',');
- if (state-&gt;array_nl) fbuffer_append(state-&gt;array_delim, state-&gt;array_nl, state-&gt;array_nl_len);
-
- generate_json(buffer, self, state, obj, NIL_P(depth) ? 0 : FIX2INT(depth));
- result = fbuffer2rstring(buffer);
- fbuffer_free_only_buffer(buffer);
- FORCE_UTF8(result);
- return result;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="space-method" class="method-detail ">
- <a name="M000107"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">space()</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is used to insert a space between the tokens in a <a
-href="../../../JSON.html">JSON</a> string.
-</p>
-
-
-
- <div class="method-source-code"
- id="space-source">
-<pre>
-static VALUE cState_space(VALUE self)
-{
- GET_STATE(self);
- return state-&gt;space ? rb_str_new2(state-&gt;space) : rb_str_new2(&quot;&quot;);
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="space--method" class="method-detail ">
- <a name="M000108"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">space=(space)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is used to insert a space between the tokens in a <a
-href="../../../JSON.html">JSON</a> string.
-</p>
-
-
-
- <div class="method-source-code"
- id="space--source">
-<pre>
-static VALUE cState_space_set(VALUE self, VALUE space)
-{
- GET_STATE(self);
- Check_Type(space, T_STRING);
- if (RSTRING_LEN(space) == 0) {
- if (state-&gt;space) {
- ruby_xfree(state-&gt;space);
- state-&gt;space = NULL;
- }
- } else {
- if (state-&gt;space) ruby_xfree(state-&gt;space);
- state-&gt;space = strdup(RSTRING_PTR(space));
- }
- return Qnil;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="space-before-method" class="method-detail ">
- <a name="M000109"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">space_before()</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is used to insert a space before the &#8217;:&#8217; in <a
-href="../../../JSON.html">JSON</a> objects.
-</p>
-
-
-
- <div class="method-source-code"
- id="space-before-source">
-<pre>
-static VALUE cState_space_before(VALUE self)
-{
- GET_STATE(self);
- return state-&gt;space_before ? rb_str_new2(state-&gt;space_before) : rb_str_new2(&quot;&quot;);
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="space-before--method" class="method-detail ">
- <a name="M000110"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">space_before=(space_before)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-This string is used to insert a space before the &#8217;:&#8217; in <a
-href="../../../JSON.html">JSON</a> objects.
-</p>
-
-
-
- <div class="method-source-code"
- id="space-before--source">
-<pre>
-static VALUE cState_space_before_set(VALUE self, VALUE space_before)
-{
- GET_STATE(self);
- Check_Type(space_before, T_STRING);
- if (RSTRING_LEN(space_before) == 0) {
- if (state-&gt;space_before) {
- ruby_xfree(state-&gt;space_before);
- state-&gt;space_before = NULL;
- }
- } else {
- if (state-&gt;space_before) ruby_xfree(state-&gt;space_before);
- state-&gt;space_before = strdup(RSTRING_PTR(space_before));
- }
- return Qnil;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- <div id="to-h-method" class="method-detail ">
- <a name="M000122"></a>
-
- <div class="method-heading">
-
- <span class="method-callseq">to_h</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
-
- <div class="method-description">
-
- <p>
-Returns the configuration instance variables as a hash, that can be passed
-to the configure method.
-</p>
-
-
-
- <div class="method-source-code"
- id="to-h-source">
-<pre>
-static VALUE cState_to_h(VALUE self)
-{
- VALUE result = rb_hash_new();
- GET_STATE(self);
- rb_hash_aset(result, ID2SYM(i_indent), rb_str_new2(state-&gt;indent));
- rb_hash_aset(result, ID2SYM(i_space), rb_str_new2(state-&gt;space));
- rb_hash_aset(result, ID2SYM(i_space_before), rb_str_new2(state-&gt;space_before));
- rb_hash_aset(result, ID2SYM(i_object_nl), rb_str_new2(state-&gt;object_nl));
- rb_hash_aset(result, ID2SYM(i_array_nl), rb_str_new2(state-&gt;array_nl));
- rb_hash_aset(result, ID2SYM(i_allow_nan), state-&gt;allow_nan ? Qtrue : Qfalse);
- rb_hash_aset(result, ID2SYM(i_ascii_only), state-&gt;ascii_only ? Qtrue : Qfalse);
- rb_hash_aset(result, ID2SYM(i_max_nesting), LONG2FIX(state-&gt;max_nesting));
- return result;
-}</pre>
- </div>
-
- </div>
-
-
- </div>
-
-
- </div>
-
-
- </div>
-
-
- <div id="rdoc-debugging-section-dump" class="debugging-section">
-
- <p>Disabled; run with --debug to generate this.</p>
-
- </div>
-
- <div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
- Rdoc Generator</a> 1.1.6</small>.</p>
- </div>
-
-</body>
-</html>
-