本文整理汇总了C#中RubyArray.Push方法的典型用法代码示例。如果您正苦于以下问题:C# RubyArray.Push方法的具体用法?C# RubyArray.Push怎么用?C# RubyArray.Push使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RubyArray
的用法示例。
在下文中一共展示了RubyArray.Push方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadObject0
//.........这里部分代码省略.........
{
// TODO: 1.8 compatibility; remove escapes undefined in 1.8
/*
char *ptr = RSTRING_PTR(str), *dst = ptr, *src = ptr;
long len = RSTRING_LEN(str);
long bs = 0;
for (; len-- > 0; *dst++ = *src++) {
switch (*src) {
case '\\': bs++; break;
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
case 'm': case 'o': case 'p': case 'q': case 'u': case 'y':
case 'E': case 'F': case 'H': case 'I': case 'J': case 'K':
case 'L': case 'N': case 'O': case 'P': case 'Q': case 'R':
case 'S': case 'T': case 'U': case 'V': case 'X': case 'Y':
if (bs & 1) --dst;
default: bs = 0; break;
}
}
rb_str_set_len(str, dst - ptr);
*/
}
v = Entry0(new RubyRegexp(str, (RubyRegexpOptions)options), idx);
v = Leave(v);
}
break;
case RubyMarshal.Types.Array:
{
int len = ReadLong();
RubyArray ary = new RubyArray();
v = ary;
v = Entry(v);
while (len-- > 0)
{
ary.Push(ReadObject());
}
v = Leave(v);
}
break;
case RubyMarshal.Types.Hash:
case RubyMarshal.Types.HashWithDefault:
{
int len = ReadLong();
RubyHash hash = new RubyHash();
v = hash;
v = Entry(v);
while (len-- > 0)
{
object key = ReadObject();
object value = ReadObject();
hash.Add(key, value);
}
if (type == RubyMarshal.Types.HashWithDefault)
{
hash.DefaultValue = ReadObject();
}
v = Leave(v);
}
break;
case RubyMarshal.Types.Struct:
{
int idx = Prepare();
RubyStruct obj = new RubyStruct();
RubySymbol klass = ReadUnique();
obj.ClassName = klass;
int len = ReadLong();
v = obj;