• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MutableString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Scalar

 internal Node Scalar(MutableString taguri, MutableString value, SymbolId style) {
     return Scalar(
         taguri != null ? taguri.ConvertToString() : "",
         value != null ? value.ConvertToString() : "",
         //It's not clear what style argument really means, it seems to be always :plain
         //for now we are ignoring it, defaulting to \0 (see Representer class)
         '\0'
     );
 }
开发者ID:bclubb,项目名称:ironruby,代码行数:9,代码来源:RubyRepresenter.cs


示例17: Decode

        public static string Decode(string value)
        {
            var result = new MutableString(WebUtility.HtmlDecode(value));
            foreach (var entity in _entities)
            {
                result.Replace(entity.Key, entity.Value);
            }

            return result;
        }
开发者ID:KarlDirck,项目名称:cavity,代码行数:10,代码来源:Html.cs


示例18: CheckContent

        private static MutableString/*!*/ CheckContent(MutableString/*!*/ content, IOMode mode) {
            if (content.IsFrozen && mode.CanWrite()) {
                throw Errno.CreateEACCES("Permission denied");
            }

            if ((mode & IOMode.Truncate) != 0) {
                content.Clear();
            }
            return content;
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:10,代码来源:StringIO.cs


示例19: Require

        public static object/*!*/ Require(RubyScope/*!*/ scope, RubyModule/*!*/ self, MutableString/*!*/ libraryName) {
            object loaded;
            
            scope.RubyContext.Loader.LoadFile(
                null, self, libraryName, LoadFlags.LoadOnce | LoadFlags.AppendExtensions | LoadFlags.ResolveLoaded, out loaded
            );

            Debug.Assert(loaded != null);
            return loaded;
        }
开发者ID:gregmalcolm,项目名称:ironruby,代码行数:10,代码来源:IronRubyOps.cs


示例20: RubyDir

 public RubyDir([NotNull]MutableString/*!*/ dirname) {
     string strName = dirname.ConvertToString();
     try {
         _rawEntries = Directory.GetFileSystemEntries(strName);
     } catch (Exception ex) {
         throw ToRubyException(ex, strName, DirectoryOperation.Open);
     }
     _dirName = MutableString.Create(RubyUtils.CanonicalizePath(strName), RubyEncoding.Path);
     _closed = false;
     _pos = -2;
 }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:11,代码来源:Dir.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Mutex类代码示例发布时间:2022-05-24
下一篇:
C# MutablePropertyValues类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap