Explorar o código

[cpp] Add toString function to ConstCharStart

hughsando %!s(int64=10) %!d(string=hai) anos
pai
achega
22392b0730
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      std/cpp/ConstCharStar.hx

+ 3 - 0
std/cpp/ConstCharStar.hx

@@ -7,6 +7,9 @@ abstract ConstCharStar( RawConstPointer<Char> ) to(RawConstPointer<Char>)
    @:from
    static public inline function fromString(s:String) return new ConstCharStar(s);
 
+   @:to
+   public inline function toString():String return new String(untyped this);
+
     @:to @:extern
     public inline function toPointer() return this;
 }