Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added the OutputText function along with unit tests for it.
[xestiacalendar/.git] / source / common / text.cpp
index fff4c83..1768488 100644 (file)
@@ -304,4 +304,38 @@ void SplitPathFilename(string *CalendarEntryHREF, string *EntryURIPath,
        
        (*EntryFilename) = CalendarEntryHREF->substr((LastForwardSlash + 1));
                
+}
+
+string OutputText(string *TextInput){
+       
+       string OutputTextData;
+       string OutputLine;
+       int CharSeek = 0;
+       int LineSeek = 0;
+       int MaxLineSeek = 77;
+       
+       for (CharSeek = 0; CharSeek < TextInput->size(); CharSeek++){
+               
+               LineSeek++;
+               
+               if (LineSeek == MaxLineSeek){
+
+                       OutputLine += TextInput->substr(CharSeek, 1);                   
+                       OutputLine += "\n";
+                       OutputTextData += OutputLine;
+                       OutputLine = " ";
+                       LineSeek = 0;
+                       MaxLineSeek = 76;
+                       continue;
+                       
+               }
+               
+               OutputLine += TextInput->substr(CharSeek, 1);
+               
+       }
+
+       OutputTextData += OutputLine;
+       
+       return OutputTextData;
+       
 }
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy