Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Smart suggestions for C++ stream interfaces

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
jschultz Posted - Dec 22 2016 : 11:00:07 AM
Let's say you want to write to a file:

std::ofstream of("out", std::ios::binary | std::ios::trunc);

The second parameter of the stream constructor is a combination of flags, and since this is by default not typesafe, it is a regular integer parameter. VAX is not aware of this, so it does not give any sensible suggestions here. If you already started typing up until "std::ios::", you get all kinds of useless suggestions from the ios namespace which do not make sense here.

Suggesting the allowed/sensible set of flags from std::ios for these standard library functions would be great. The same is true for the std::ios::beg/cur/end parameter for seek functions (and probably a few others I cannot remember right now).

I'm using the latest VAX on VS2015.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 02 2017 : 1:47:10 PM
I know this is the STL, but a lot of people use a lot of different libraries, which would make extending / scaling this idea difficult. Have you considered using VA Snippets for this? If you copy and paste the following into your VA Snippet editor:


<VA_Snippet>
<Language>C++</Language>
<Title />
<Shortcut>ios</Shortcut>
<Description />
<Code>std::ios::binary</Code>
</VA_Snippet>

<VA_Snippet>
<Language>C++</Language>
<Title />
<Shortcut>ios</Shortcut>
<Description />
<Code>std::ios::trunc</Code>
</VA_Snippet>


it will give you two snippets, both with the shortcut "ios" for the two flags you have used here. If you now type "ios" both snippets are suggested, so you can pick the snippet / flag that you want.

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