summaryrefslogtreecommitdiff
path: root/doc/classes/JSON/Ext/Generator/State.src/M000121.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/JSON/Ext/Generator/State.src/M000121.html')
-rw-r--r--doc/classes/JSON/Ext/Generator/State.src/M000121.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/classes/JSON/Ext/Generator/State.src/M000121.html b/doc/classes/JSON/Ext/Generator/State.src/M000121.html
new file mode 100644
index 0000000..c3556c3
--- /dev/null
+++ b/doc/classes/JSON/Ext/Generator/State.src/M000121.html
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>initialize_copy (JSON::Ext::Generator::State)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre>/*
+ * call-seq: initialize_copy(orig)
+ *
+ * Initializes this object from orig if it to be duplicated/cloned and returns
+ * it.
+*/
+static VALUE cState_init_copy(VALUE obj, VALUE orig)
+{
+ JSON_Generator_State *objState, *origState;
+
+ Data_Get_Struct(obj, JSON_Generator_State, objState);
+ Data_Get_Struct(orig, JSON_Generator_State, origState);
+ if (!objState) rb_raise(rb_eArgError, &quot;unallocated JSON::State&quot;);
+
+ MEMCPY(objState, origState, JSON_Generator_State, 1);
+ objState-&gt;indent = fstrndup(origState-&gt;indent, origState-&gt;indent_len);
+ objState-&gt;space = fstrndup(origState-&gt;space, origState-&gt;space_len);
+ objState-&gt;space_before = fstrndup(origState-&gt;space_before, origState-&gt;space_before_len);
+ objState-&gt;object_nl = fstrndup(origState-&gt;object_nl, origState-&gt;object_nl_len);
+ objState-&gt;array_nl = fstrndup(origState-&gt;array_nl, origState-&gt;array_nl_len);
+ if (origState-&gt;array_delim) objState-&gt;array_delim = fbuffer_dup(origState-&gt;array_delim);
+ if (origState-&gt;object_delim) objState-&gt;object_delim = fbuffer_dup(origState-&gt;object_delim);
+ if (origState-&gt;object_delim2) objState-&gt;object_delim2 = fbuffer_dup(origState-&gt;object_delim2);
+ return obj;
+}</pre>
+</body>
+</html> \ No newline at end of file