@@ -291,63 +291,68 @@ RLCPPAPI inline unsigned int TextLength(const std::string& text) {
291291 * Get text length, checks for '\0' ending
292292 */
293293RLAPI inline std::string TextSubtext (const std::string& text, int position, int length) {
294- return TextSubtext (text.c_str (), position, length);
294+ return :: TextSubtext (text.c_str (), position, length);
295295}
296296
297297/* *
298298 * Replace text string (WARNING: memory must be freed!)
299299 */
300300RLAPI inline std::string TextReplace (const std::string& text, const std::string& replace, const std::string& by) {
301- return TextReplace (text.c_str (), replace.c_str (), by.c_str ());
301+ char * output = ::TextReplace ((char *)text.c_str (), replace.c_str (), by.c_str ());
302+ if (output != NULL ) {
303+ std::string stringOutput (output);
304+ free (output);
305+ return stringOutput;
306+ }
307+ return " " ;
302308}
303309
304310/* *
305311 * Insert text in a position (WARNING: memory must be freed!)
306312 */
307313RLAPI inline std::string TextInsert (const std::string& text, const std::string& insert, int position) {
308- return TextInsert (text.c_str (), insert.c_str (), position);
309- }
310-
311- /* *
312- * Append text at specific position and move cursor!
313- */
314- RLAPI inline void TextAppend (const std::string& text, const std::string& append, int *position) {
315- return TextAppend (text.c_str (), append.c_str (), position);
314+ char * output = ::TextInsert (text.c_str (), insert.c_str (), position);
315+ if (output != NULL ) {
316+ std::string stringOutput (output);
317+ free (output);
318+ return stringOutput;
319+ }
320+ return " " ;
316321}
317322
318323/* *
319324 * Find first text occurrence within a string
320325 */
321326RLAPI inline int TextFindIndex (const std::string& text, const std::string& find) {
322- return TextFindIndex (text.c_str (), find.c_str ());
327+ return :: TextFindIndex (text.c_str (), find.c_str ());
323328}
324329
325330/* *
326331 * Get upper case version of provided string
327332 */
328333RLAPI inline std::string TextToUpper (const std::string& text) {
329- return TextToUpper (text.c_str ());
334+ return :: TextToUpper (text.c_str ());
330335}
331336
332337/* *
333338 * Get lower case version of provided string
334339 */
335340RLAPI inline std::string TextToLower (const std::string& text) {
336- return TextToLower (text.c_str ());
341+ return :: TextToLower (text.c_str ());
337342}
338343
339344/* *
340345 * Get Pascal case notation version of provided string
341346 */
342347RLAPI inline std::string TextToPascal (const std::string& text) {
343- return TextToPascal (text.c_str ());
348+ return :: TextToPascal (text.c_str ());
344349}
345350
346351/* *
347352 * Get integer value from text (negative values not supported)
348353 */
349354RLAPI inline int TextToInteger (const std::string& text) {
350- return TextToInteger (text.c_str ());
355+ return :: TextToInteger (text.c_str ());
351356}
352357
353358} // namespace raylib
0 commit comments