Beispiel #1
0
 public static MutableString/*!*/ Inspect(ClrName/*!*/ self) {
     return ClrString.Inspect(self.MangledName);
 }
Beispiel #2
0
 public static MutableString/*!*/ Dump(ClrName/*!*/ self) {
     return ClrString.Dump(self.MangledName);
 }
Beispiel #3
0
 public static int Compare(ClrName/*!*/ self, [NotNull]MutableString/*!*/ other) {
     // TODO: do not create MS
     return -Math.Sign(other.CompareTo(MutableString.Create(self.MangledName, RubyEncoding.UTF8)));
 }
Beispiel #4
0
 public static MutableString GetClrName(RubyContext/*!*/ context, ClrName/*!*/ self)
 {
     return MutableString.Create(self.ActualName, context.GetIdentifierEncoding());
 }
Beispiel #5
0
 public static bool IsEqual(ClrName/*!*/ self, [NotNull]MutableString/*!*/ other) {
     return self.MangledName == other.ConvertToString();
 }
Beispiel #6
0
 public static int Compare(ClrName/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ other) {
     return Math.Sign(self.MangledName.CompareTo(other));
 }
Beispiel #7
0
 public static int GetLength(ClrName/*!*/ self) {
     return self.MangledName.Length;
 }
Beispiel #8
0
 public static SymbolId ToSymbol(ClrName/*!*/ self) {
     return SymbolTable.StringToId(self.MangledName);
 }
Beispiel #9
0
 public static bool IsEmpty(ClrName/*!*/ self) {
     return self.MangledName.Length == 0;
 }
Beispiel #10
0
 public static RubyEncoding/*!*/ GetEncoding(ClrName/*!*/ self) {
     return RubyEncoding.UTF8;
 }
Beispiel #11
0
 public static object Match(BinaryOpStorageWithScope/*!*/ storage, RubyScope/*!*/ scope, ClrName/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ pattern) {
     return MutableStringOps.Match(storage, scope, GetRubyName(scope.RubyContext, self), pattern);
 }
Beispiel #12
0
 public static object Match(BinaryOpStorageWithScope/*!*/ storage, RubyScope/*!*/ scope, ClrName/*!*/ self, [NotNull]RubyRegex/*!*/ regex) {
     return MutableStringOps.Match(storage, scope, GetRubyName(scope.RubyContext, self), regex);
 }
Beispiel #13
0
 public static object Match(BinaryOpStorageWithScope/*!*/ storage, RubyScope/*!*/ scope, ClrName/*!*/ self, object obj) {
     return MutableStringOps.Match(storage, scope, GetRubyName(scope.RubyContext, self), obj);
 }
Beispiel #14
0
 public static MutableString/*!*/ GetClrName(ClrName/*!*/ self) {
     return MutableString.Create(self.ActualName);
 }
Beispiel #15
0
 public static MutableString/*!*/ GetRubyName(RubyContext/*!*/ context, ClrName/*!*/ self) {
     return MutableString.Create(self.MangledName, context.GetIdentifierEncoding());
 }
Beispiel #16
0
 public static MutableString/*!*/ GetRubyName(ClrName/*!*/ self) {
     return MutableString.Create(self.MangledName);
 }
Beispiel #17
0
 public static RubySymbol/*!*/ ToSymbol(RubyContext/*!*/ context, ClrName/*!*/ self) {
     return context.EncodeIdentifier(self.MangledName);
 }
Beispiel #18
0
 public static bool IsEqual(ClrName/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ other) {
     return self.MangledName == other;
 }
Beispiel #19
0
 public static int Compare(ClrName/*!*/ self, [NotNull]ClrName/*!*/ other) {
     return String.CompareOrdinal(self.MangledName, other.MangledName);
 }
Beispiel #20
0
 public static bool IsEqual(ClrName/*!*/ self, [NotNull]ClrName/*!*/ other) {
     return self.Equals(other);
 }
Beispiel #21
0
 public static int Compare(RubyContext/*!*/ context, ClrName/*!*/ self, [NotNull]MutableString/*!*/ other) {
     // TODO: do not create MS
     return -Math.Sign(other.CompareTo(GetRubyName(context, self)));
 }
Beispiel #22
0
 public static int Compare(ClrName/*!*/ self, [NotNull]ClrName/*!*/ other) {
     return self.MangledName.CompareTo(other.MangledName);
 }
Beispiel #23
0
 public static object Match(ClrName/*!*/ self, [NotNull]RubySymbol/*!*/ str) {
     throw RubyExceptions.CreateTypeError("type mismatch: Symbol given");
 }
Beispiel #24
0
 public static object Compare(BinaryOpStorage/*!*/ comparisonStorage, RespondToStorage/*!*/ respondToStorage, ClrName/*!*/ self, object other) {
     return MutableStringOps.Compare(comparisonStorage, respondToStorage, self.MangledName, other);
 }
Beispiel #25
0
 public static bool IsEqual(RubyContext/*!*/ context, ClrName/*!*/ self, [NotNull]RubySymbol/*!*/ other)
 {
     return other.Equals(GetRubyName(context, self));
 }