当前位置: 首页>>代码示例>>C#>>正文


C# MutableString类代码示例

本文整理汇总了C#中MutableString的典型用法代码示例。如果您正苦于以下问题:C# MutableString类的具体用法?C# MutableString怎么用?C# MutableString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MutableString类属于命名空间,在下文中一共展示了MutableString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Load

 public static object Load(RubyScope/*!*/ scope, RubyModule/*!*/ self, MutableString/*!*/ libraryName)
 {
     object loaded;
     scope.RubyContext.Loader.LoadFile(null, self, libraryName, LoadFlags.ResolveLoaded | LoadFlags.AnyLanguage, out loaded);
     Debug.Assert(loaded != null);
     return loaded;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:IronRubyOps.cs

示例2: RubyFileOps

 static RubyFileOps()
 {
     ALT_SEPARATOR = MutableString.CreateAscii(AltDirectorySeparatorChar.ToString()).Freeze();
     SEPARATOR = MutableString.CreateAscii(DirectorySeparatorChar.ToString()).Freeze();
     Separator = SEPARATOR;
     PATH_SEPARATOR = MutableString.CreateAscii(PathSeparatorChar.ToString()).Freeze();
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:FileOps.cs

示例3: ZlibInflate

 /// <summary>
 /// Inflates the compressed string using Ruby's Zlib module
 /// </summary>
 /// <param name="data">The Ruby string to decompress</param>
 /// <returns>The decompressed Ruby string as a System.String</returns>
 public static string ZlibInflate(MutableString data)
 {
     _rubyScope.SetVariable("data", data);
       MutableString result = _rubyEngine.Execute(@"Zlib::Inflate.inflate(data)", _rubyScope);
       _rubyScope.RemoveVariable("data");
       return ConvertString(result);
 }
开发者ID:revam,项目名称:Gemini,代码行数:12,代码来源:Ruby.cs

示例4: CharArrayContent

 internal CharArrayContent(char[]/*!*/ data, int count, MutableString owner) 
     : base(owner) {
     Assert.NotNull(data);
     Debug.Assert(count >= 0 && count <= data.Length);
     _data = data;
     _count = count;
 }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:7,代码来源:MutableString.CharArrayContent.cs

示例5: Subclass

 public Subclass(RubyClass/*!*/ rubyClass, MutableString begin, MutableString end, bool excludeEnd)
     : base(begin, end, excludeEnd)
 {
     Assert.NotNull(rubyClass);
     Debug.Assert(!rubyClass.IsSingletonClass);
     ImmediateClass = rubyClass;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:Range.Subclass.cs

示例6: JsonWriter

 private JsonWriter()
 {
     Nesting = new Stack<JsonWriterState>();
     Nesting.Push(new JsonWriterState(JsonNodeType.None));
     Indent = new MutableString();
     Settings = Settings ?? JsonWriterSettings.Terse;
 }
开发者ID:KarlDirck,项目名称:cavity,代码行数:7,代码来源:JsonWriter.cs

示例7: GetMatches

 /*!*/
 public static IEnumerable<MutableString> GetMatches(RubyContext/*!*/ context, MutableString/*!*/ pattern, int flags)
 {
     string strPattern = context.DecodePath(pattern);
     foreach (string strFileName in GetMatches(context.Platform, strPattern, flags)) {
         yield return context.EncodePath(strFileName).TaintBy(pattern);
     }
 }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:Glob.cs

示例8: Range

 public Range(MutableString/*!*/ begin, MutableString/*!*/ end, bool excludeEnd)
 {
     _begin = begin;
     _end = end;
     _excludeEnd = excludeEnd;
     _initialized = true;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:Range.cs

示例9: CreateFile

        public static RubyFile/*!*/ CreateFile(RubyClass/*!*/ self, MutableString/*!*/ path, int mode) {
            if (path.IsEmpty) {
                throw new Errno.InvalidError();
            }

            return new RubyFile(self.Context, path.ConvertToString(), (RubyFileMode)mode);
        }
开发者ID:jcteague,项目名称:ironruby,代码行数:7,代码来源:FileOps.cs

示例10: IComparableOfMutableString_op_CompareTo_objectNull

        public void IComparableOfMutableString_op_CompareTo_objectNull()
        {
            IComparable<MutableString> obj = new MutableString("a");

            var expected = string.CompareOrdinal("a", null);

            Assert.Equal(expected, obj.CompareTo(null));
        }
开发者ID:KarlDirck,项目名称:cavity,代码行数:8,代码来源:MutableString.Facts.cs

示例11: ICloneable_op_Clone

        public void ICloneable_op_Clone()
        {
            ICloneable expected = new MutableString("One");
            var actual = expected.Clone();

            Assert.Equal(expected, actual);
            Assert.NotSame(expected, actual);
        }
开发者ID:KarlDirck,项目名称:cavity,代码行数:8,代码来源:MutableString.Facts.cs

示例12: FastXs

 public static MutableString FastXs(RubyContext/*!*/ context, MutableString/*!*/ self)
 {
     //TODO: we are assuming that every string is UTF8, but this is wrong
     String utf8String = Encoding.UTF8.GetString(self.ToByteArray());
     StringBuilder builder = new StringBuilder((int)(utf8String.Length * 1.5));
     Entities.XML.Escape(builder, utf8String);
     return MutableString.CreateAscii(builder.ToString());
 }
开发者ID:nrk,项目名称:ironruby-hpricot,代码行数:8,代码来源:BuiltinsOps.cs

示例13: Execute

            public static RubyArray Execute(RhoDatabase/*!*/ self, MutableString/*!*/ sqlStatement, Boolean isBatch, RubyArray args)
            {
                try
                {
                    RubyArray retArr = new RubyArray();

                    if (isBatch)
                    {
                        self.m_db.executeBatchSQL(sqlStatement.ToString());
                    }
                    else
                    {
                        Object[] values = null;
                        if (args != null && args.Count > 0)
                        {
                            if (args[0] != null && args[0] is RubyArray)
                                values = ((RubyArray)args[0]).ToArray();
                            else
                                values = args.ToArray();
                        }

                        try
                        {
                            self.m_db.Lock();
                            using (IDBResult rows = self.m_db.executeSQL(sqlStatement.ToString(), values, true))
                            {
                                if (rows != null)
                                {
                                    MutableString[] colNames = null;
                                    for (; !rows.isEnd(); rows.next())
                                    {
                                        IDictionary<object, object> map = new Dictionary<object, object>();
                                        Hash row = new Hash(map);
                                        for (int nCol = 0; nCol < rows.getColCount(); nCol++)
                                        {
                                            if (colNames == null)
                                                colNames = getOrigColNames(rows);

                                            row.Add(colNames[nCol], rows.getRubyValueByIdx(nCol));
                                        }
                                        retArr.Add(row);
                                    }
                                }
                            }
                        }
                        finally
                        {
                            self.m_db.Unlock();
                        }
                    }

                    return retArr;
                }catch (Exception exc)
                {
                    //TODO: throw ruby exception
                    throw exc;
                }
            }
开发者ID:Chanic,项目名称:rhodes,代码行数:58,代码来源:RhoDatabase.cs

示例14: IComparableOfMutableString_op_CompareTo_MutableString

        public void IComparableOfMutableString_op_CompareTo_MutableString(string comparand1,
                                                                          string comparand2)
        {
            IComparable<MutableString> obj = new MutableString(comparand1);
            var expected = string.CompareOrdinal(comparand1, comparand2);
            var actual = obj.CompareTo(comparand2);

            Assert.Equal(expected, actual);
        }
开发者ID:KarlDirck,项目名称:cavity,代码行数:9,代码来源:MutableString.Facts.cs

示例15: GetBytePtr

 public static unsafe IntPtr GetBytePtr(MutableString str)
 {
     IntPtr pp;
       fixed (byte* bp = str.ToByteArray())
       {
     pp = (IntPtr)bp;
       }
       return pp;
 }
开发者ID:trietptm,项目名称:retoolkit,代码行数:9,代码来源:Helpers.cs


注:本文中的MutableString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。