本文整理汇总了C#中RubyContext.GetPathEncoding方法的典型用法代码示例。如果您正苦于以下问题:C# RubyContext.GetPathEncoding方法的具体用法?C# RubyContext.GetPathEncoding怎么用?C# RubyContext.GetPathEncoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RubyContext
的用法示例。
在下文中一共展示了RubyContext.GetPathEncoding方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HostNameToMutableString
internal static MutableString/*!*/ HostNameToMutableString(RubyContext/*!*/ context, string/*!*/ str) {
if (str.IsAscii()) {
return MutableString.CreateAscii(str);
} else {
return MutableString.Create(str, context.GetPathEncoding());
}
}
示例2: RubyStackTraceBuilder
private RubyStackTraceBuilder(RubyContext/*!*/ context) {
_hasFileAccessPermission = DetectFileAccessPermissions();
_exceptionDetail = context.Options.ExceptionDetail;
_encoding = context.GetPathEncoding();
_trace = new RubyArray();
}
示例3: GetAllNames
public static RubyArray GetAllNames(RubyContext/*!*/ context, RubyEncoding/*!*/ self)
{
var result = new RubyArray();
string name = self.Name;
result.Add(MutableString.Create(name));
foreach (var alias in RubyEncoding.Aliases) {
if (StringComparer.OrdinalIgnoreCase.Equals(alias.Value, name)) {
result.Add(MutableString.CreateAscii(alias.Key));
}
}
if (self == context.RubyOptions.LocaleEncoding) {
result.Add(MutableString.CreateAscii("locale"));
}
if (self == context.DefaultExternalEncoding) {
result.Add(MutableString.CreateAscii("external"));
}
if (self == context.GetPathEncoding()) {
result.Add(MutableString.CreateAscii("filesystem"));
}
return result;
}
示例4: Inspect
public static MutableString/*!*/ Inspect(RubyContext/*!*/ context, RubyFile/*!*/ self) {
return MutableString.CreateMutable(context.GetPathEncoding()).
Append("#<File:").
Append(self.Path).
Append(self.Closed ? " (closed)" : "").
Append('>');
}
示例5: FrozenString
/*!*/
private static MutableString FrozenString(RubyContext/*!*/ context, object value)
{
return MutableString.Create((string)value ?? "", context.GetPathEncoding()).Freeze();
}