Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Slash conversion

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Paul Posted - Mar 08 2016 : 1:50:07 PM
It would be handy to have functions that:

1) Convert backslashes to forward slashes.
\home\my\subfolder to /home/my/subfolder
2) Convert forward slashes to doubled backslashes.
/home/my/subfolder to \\home\\my\\subfolder
3) Convert single backslashes to doubled backslashes.
\home\my\subfolder to \\home\\my\\subfolder
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 29 2016 : 2:17:11 PM
You should be able to do a regular expression find and replace to do the replacements in strings fairly easily, but this is also going to update some, possibly quite a few #include lines as well.

Swapping / to \ in your #include statements won't matter, but changing \ to \\ may.

Thinking a little more, you could put a "line not starting with #" at the start of the regular expression, which should make this fairly safe and reliable.

Depending on your IDE, you could even wrap this up in an IDE macro, to make it easy to run this across your entire project.

"formatting" like this is not something VA offers, unfortunately, since everyone wants something different, and it quickly becomes a very complex area.
Paul Posted - Mar 29 2016 : 11:54:09 AM
Mostly in strings that refer to file paths. We specify using forward slashes and let underlying code convert to the platform specific directory separators. That code can handle the backslashes as well, for neatness, consistency and correctness, I prefer everyone use the forward slashes.
feline Posted - Mar 08 2016 : 2:14:54 PM
Have you considered simply using a find and replace? Are you looking to do this on strings? #include lines? Something else?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000