Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Smart suggestions for C++ stream interfaces
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jschultz
Junior Member

24 Posts

Posted - Dec 22 2016 :  11:00:07 AM  Show Profile  Reply with Quote
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.

Edited by - jschultz on Dec 22 2016 11:02:28 AM

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jan 02 2017 :  1:47:10 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000