Netbeans: C/C++ file-template variables documentation needed - c++

I'm looking for a faq or overview on C/C++ template-file variables in Netbeans (7.0).
(Not to be confused with the template technique). Those you see under Tools > Templates > C++ templates.
e.g.
%<%CLASSNAME%>% %<%DEFAULT_HEADER_EXT%>% %<%DATE%>%
which are automatically filled when you create a new cpp/header file out of that file-template.
The help for the Java template-variables with Freemarker is very extensive, but I found nothing for the C++ equivalent.
When I did a search on CLASSNAME DEFAULT_HEADER_EXT, google gave me 5 results... which were not helpful. So if there is a reference or api, it seems to be hidden somewhere... Not even the netbeans site had any information about that.
And if there is nothing, maybe someone can at least tell me if there is a way to format the %DATE% variable (like this in Java's Freemarker format: ${date?date?string("yyyy")} ).
Still no luck... can't believe that such a feature is not documented... Any help would be appreciated :)
Thanks

I know it's an old question but just stumbled on it and think it's good to have it mentioned:
The documentation of all predefined template variables including the date formatting may be found here: http://wiki.netbeans.org/FaqTemplateVariables

Related

C.VIM not working

I have a simple question (that I don't seem to be able to answer),
I am a new VIM/Linux user, and since I do c++ development I decided to install the C.VIM plugin to speed up my development time. The problem is, it says in the plug-in (c++) menu that to do a switch statement I have to write \ss (for me the leader is ",", so it's ",ss") but when I do this it just puts me in insert mode and nothing happens. I know the plugin is well set up because when I open a new c++ file it generates a comment box where I can give the description of the program.
I would love it if I would be able to use the shortcuts, because using the menu just losses the point of using vim.
Oh and please, just keep in mind that I am new to vim, I still have hard time figuring out what means <c-r> + TAB (which is, if i'm not mistaking "ctrl-r <tab>"), so if you could just try to explain the solution clearly without to much jargon I would appreciate it. (while i'm here, does anyone know of a good vim tutorial where I could understands all of the vim jargon, thanks!)
I appreciate all the help.
I use this cheat sheet:
http://www.worldtimzone.com/res/vi.html
Please add the below line to .vimrc and
helptags ~/.vim/bundle/c.vim/doc
Note: I have pointed to my c.vim doc and I use bundle, it may differ for you :)

c++: program settings - boost.PropertyTree or boost.program_options?

I was looking for a solution to store program settings or options or configuration in C++. These could be settings that are exposed in a GUI and need to be saved between runs of my code.
In my search I came across boost.PropertyTree which seemed to be a good choice. I know boost is well respected code so I'm comfortable using it and so I started developing using this. Then I come across boost.program_options which seems to allow you to do the same thing but also looks more specialized for the specific use-case of program settings.
Now I'm wondering which is the most appropriate for the job? (or is there a 3rd option that is better than both)
EDIT:
fyi this is for a plugin so it will not use command line options (as in, it's not even possible).
UPDATE
I ended up sticking with boost.PropertyTree. I needed to be able to save changed options back to the INI, and I didn't see a way of doing that with boost.program_options.
Use boost::program_options. It's exactly what it's for. In one library you get command line options, environment variables options and an INI-like configuration file parser. And they're all integrated together in the Right way, so when then the user specifies the same option in more than one of these sources the library knows the Right priority order to consider.
boost::property_tree on the other hand is a more generalized library. The library parses the text stream into a uniform data model. But You need to do the real parsing -- that of making sense of the blob of data for your needs. The library doesn't know when to expect a parameter when it sees a particular option string, or to disallow specific values or types of values for a particular option.
After some digging around I think boost.PropertyTree is still the best solution because it gives me the capability to save the options after changing them from within the program which is a requirement.
There is a non-Boost possibility too. Config4Cpp is a robust, simple-to-use and comprehensively documented configuration-file parser library that I wrote. It is available at www.config4star.org.
I suggest you read Chapter 3 (Preferences for a GUI Application) of the Practical Usage Guide manual to read an overview of how Config4Cpp can do what you want. Then open the Getting Started Guide manual, and skim-read Chapters 2 and 3, and Section 7.4 (you might prefer to read the PDF version of that manual). Doing that should give you sufficient details to help you decide if Config4Cpp suits your needs better or worse than Boost.
By the way, the indicated chapters and sections of documentation are short, so they shouldn't take long to read.

funny looking comments - c++

when i read through source files of opensource projects i often come across some weird phrases in the comments
/*
#brief ......
#usage.....
#remarks....
#par....
*/
questions
1.What are they?(were not mentioned when i was learning c++)
2.Do they have any documentation(where)
They are just comments and as such have no special meaning in C++. They are probably to allow a documentation generator (For example Doxygen) to extract the data from the comments.
Those are for some flavour of automatic documentation generator. Another program runs through the code looking for comments of like you see there. The #... keywords identify how the documentation should be laid out, and that program generates pretty HTML or printed documentation directly from the source code. It's a way to keep the docs up-to-date with the code more easily.

Best C/C++ Library to defang HTML?

I'm looking for a C/C++ functional equivalent to HTML::Defang, and my Google-fu has not been able to uncover anything. I want to keep any benign tags and strip out/defang everything else. Lacking an actual library, any pointers to complete lists of tags/attributes/etc to defang would be appreciated. I know of http://en.wikipedia.org/wiki/DOM_Events. Thanks.
In Java, I use JTidy to clean up HTML. I'm not sure if it would suit your needs, but if you Google for JTidy you can follow the link to a C/C++ implementation as well, and see if it does what you want.
As for what to defang: Look at the W3C specs for HTML; any tag not in there doesn't belong in HTML. But again, I could be misunderstanding your "defang" concept.
libxml2 is free and should do what you want.
http://www.xmlsoft.org/
See this part of the API: http://www.xmlsoft.org/html/libxml-HTMLparser.html
The htmlReadFile() function might do the trick.
To get you started with libxml2 some examples can be found here:
http://www.xmlsoft.org/examples/index.html

Viewing language (C/C++) reference/documentation in CodeBlocks

My first question on StackOverflow...
Does anybody know a way of viewing the reference/documentation manual of a language through CodeBlocks? Specifically for C/C++.
Example:
Say I want to look up the reference for strncpy(). In a very old Borland system (which we use at school) I would write the word and middle-click on it, thus being taken to its reference. It would also be nice if one can browse through the manual in some way.
Have I completely overlooked this (also searching google), or is it missing?
If it's missing, what's the quickest way of searching the C and/or reference manual without being online?
Regards!
Yes, it is possible. I'm not sure about the help files themselves though.
The procedure seems to be documented here.
from the forums.
Re: F1 - help and function reference
« Reply #1 on: September 15, 2008, 02:07:59 pm »
if you have the help plugin installed, you can set help files through "Settings->Environment" and clicking on "Help files" in the list to the left.
The default file is called when pressing F1..
Logged
starmaker
Newcomer
*
Posts: 3
Re: F1 - help and function reference
« Reply #2 on: September 15, 2008, 06:57:29 pm »
You are right but is there any up do date documentation ?
Now I use MSDN or cppreference.com web pages.
Regards,
starmaker
I found the complete answer. Based on your reply EvilTech.
Here's the setup procedure for different systems:
http://wiki.codeblocks.org/index.php?title=Help_plugin
And here are the help files for C++ compiled from an online source:
http://onnerby.se/~daniel/chm/
I find it strange though that I couldn't find any other help files for C "out there". I also had problems viewing the .chm files. The list of keywords of the file are shown, but the contents of each keyword does not show. Turns out this is comes from a windows security update. The solution is to right-click on the file -> properties -> click on "unblock".
(BTW, do you mean Code::Blocks)
Having never used that, I can say anything definite, but have you tried selecting the term and pressing F1?
Why not ask this in the forums of Code::Blocks?