本文整理汇总了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;
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例6: JsonWriter
private JsonWriter()
{
Nesting = new Stack<JsonWriterState>();
Nesting.Push(new JsonWriterState(JsonNodeType.None));
Indent = new MutableString();
Settings = Settings ?? JsonWriterSettings.Terse;
}
示例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);
}
}
示例8: Range
public Range(MutableString/*!*/ begin, MutableString/*!*/ end, bool excludeEnd)
{
_begin = begin;
_end = end;
_excludeEnd = excludeEnd;
_initialized = true;
}
示例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);
}
示例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));
}
示例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);
}
示例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());
}
示例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;
}
}
示例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);
}
示例15: GetBytePtr
public static unsafe IntPtr GetBytePtr(MutableString str)
{
IntPtr pp;
fixed (byte* bp = str.ToByteArray())
{
pp = (IntPtr)bp;
}
return pp;
}