NOTICE: add Alexandre Blondin Massé
[nit.git] / lib / cpp.nit
index 4eeb2a5..6fe897a 100644 (file)
@@ -24,11 +24,13 @@ extern class CppString in "C++" `{ std::string* `}
 end
 
 redef class Text
-       fun to_cpp_string: CppString do return to_cstring.to_cpp_string
+       # Get `self` as a `CppString`
+       fun to_cpp_string: CppString do return to_cstring.to_cpp_string(length)
 end
 
 redef class NativeString
-       fun to_cpp_string: CppString in "C++" `{
-               return new std::string(recv);
+       # Get `self` as a `CppString`
+       fun to_cpp_string(length: Int): CppString in "C++" `{
+               return new std::string(recv, length);
        `}
 end