Get a Done list with doxygen - c

It is well known how to obtain a TODO list in Doxygen, typing:
\todo Item one
\todo Item two
and so on, but when something has been done, how to keep track of this?
If I have done item two I don't want to remove it, I want to mark it as done:
\todo Item ono
\done Item two
How do I do this?

I dug around in the Doxygen documentation and stumbled over the \xrefitem. It's supposed to be:
A generalization of commands such as \todo and \bug. It can be used to
create user-defined text sections which are automatically
cross-referenced between the place of occurrence and a related page,
which will be generated. On the related page all sections of the same
type will be collected.
The first argument is an identifier uniquely representing the
type of the section. The second argument is a quoted string
representing the heading of the section under which text passed as the
fourth argument is put. The third argument (list title) is used as the
title for the related page containing all items with the same key. The
keys "todo", "test", "bug" and "deprecated" are predefined.
So you could specify a new alias, e.g. "done" in your Doxyfile:
ALIASES += "done=\xrefitem done \"Implemented TODOs\" \"Implemented
TODOs\" "
And in your code you should be able to use the new "done" tag like all the others:
/// \done fixed broken function

According to the doxygen manual there is no such "inverse" of the \todo command. Perhaps you can just keep the \todo and mark it manually as done, somehow.
Unfortunately doxygen's Markdown doesn't seem to support strikethrough (unlike Stack Overflow's, obviously), that would otherwise have been a good and common choice. Perhaps you can set it up using custom styling and spans.

Related

MFC MDI CMFCPropertyGridProperty adding Array for dropdown list merging MP4 tag data

I need some guidance on how to add a drop down list from an array of data after the read info from the MP4 Tag data is parsed. The mechanism I'm using is 100% operational, this is a creature feature addition. The MP4 tag I'm working with is Genre using the ID3V1 standard. There are 191 choices. The way my app was inherited, there are 2 columns, property/value and multiple rows. All of that works. The Genre tag was setup willy nilly so you could basically type whatever and it would store it. I want to remove that and have the 191 elements in the array to choose from using the drop down list. Part of the loading process is that it will pull in whatever was in the MP4 file. So, I want the user to be able to leave as is (most likely tagged by something that supports ID3V2), or select from the populated 191 elements in the dropdown list.
The object looks like this information.h:
protected:
CMFCPropertyGridCtrl m_wndProperties;
The information.cpp looks like this:
void CInformationView::OnInitialUpdate()
{
// create property grid
VERIFY(m_wndProperties.Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP| WS_BORDER, CRect(0,0,0,0), this, 0));
// get document
CMovieDoc *lpkDoc = GetDocument();
ASSERT_VALID_PTR(lpkDoc);
// add properties //Information ORDER Loading <<<<< List shortened Stack overflow question
m_wndProperties.AddProperty(lpkDoc->m_pkArtist);
m_wndProperties.AddProperty(lpkDoc->m_pkTempo);
m_wndProperties.AddProperty(lpkDoc->m_pkGenre);
CView::OnInitialUpdate();
}
The way it pulls the data in from mp4.cpp:
// Genre
m_pkGenre = new CMFCPropertyGridProperty(_T("Genre"),
COleVariant(AfxStringFromUtf8(lptTags->genre), VT_BSTR));
The pointers in mp4.h:
CMFCPropertyGridProperty *m_pkArtist;
CMFCPropertyGridProperty *m_pkTempo;
CMFCPropertyGridProperty *m_pkGenre;
Now I know that pull downs in the 2nd column (Values) can be done because other tags have simple TRUE/FALSE that can be selected, so that tells me it should be possible to create the drop down list I'm looking to do. An example of the TRUE/FALSE looks like this:
// Compilation
m_pkCompilation = new CMFCPropertyGridProperty(_T("Compilation"),
COleVariant((!VALID_PTR(lptTags->compilation)) ? (short)0 : (short)*lptTags->compilation, VT_BOOL));
I've done arrays in C for things like microcontrollers, but not entirely sure if it is the same in C++. I'm thinking it should look like this:
// Initialize Genre Array
const char *genre[4] = { "Rock", "Rap", "Soul", "House" };
The questions are:
How do I create an the array (or does my example above look correct?) to house fixed strings like "Rock", "Rap", "Soul", etc. etc?
How to modify the VALUE row to have the pull down that contains the parsed Genre tag present and then when opened, show the 191 Genre tags where one can be selected to choose from (and ultimately save which is already working).
Actual code, not references to the learn.microsoft.com, the few things I've tried crashes when I try to alter the AddProperties I assume because of the lpkDoc pointers being used.
You should not use a plain old C-style array if you do not have a strong reason to. Use a std::vector instead. You don't even need to indicate the [size].
The same goes for char *. Use a CString or astd::string instead.
const std::vector<CString> = { L"Rock", L"Rap", L"Soul", L"House" };
Don't make your life harder than it needs to be.
2.
for (size_t i= 0; i < genre.size(); i++)
{
auto gnr= genre[i];
lpkDoc->m_pkGenre->AddOption(gnr);
}
or even better
for (auto it : genre)
{
lpkDoc->m_pkGenre->AddOption(it);
}
Important note: You should not have code about properties in your doc object. You are mixing business logic with user interaction logic. Your code in the future will be a nightmare to maintain.
I do not see your lpkDoc->m_pk variable init'ed anywhere, and I bet those pointers are pointing to no man's land.

How to verify words one by one on a locator in Robot Framework?

I am still a bit new to the robot framework but please rest assured I am constantly reading its User Guide. I am a bit stuck now with one test case.
I do have a list of individual words, that I need to verify on a page, mostly German translations of field labels if they appear correctly or are found in an element at all.
I have created a list variable as follows:
#{GERMAN_WORDS} | Benutzer | Passwort | Sendung | Transaktionen | Notiz
I have the following locator that contains the text labels on the webpage, and the one I need to verify:
${GENERAL_GERMAN_BOARD} |
xpath=//*[#id="generalAndIncidents:generalAndIncidentsPanel"]
I would like to check every single word one by one from the list variable, whether they are present in the locator above.
I did create the following keyword for this purpose, however I might be missing something because it calls the entire content of my list variable, instead of checking the words from it one by one:
Block Text Verification
[Arguments] ${text_list_variable} ${locator_to_check}
Wait Until Element is Visible ${locator_to_check}
FOR ${label} IN ${text_list_variable}
${labelTostring} Convert to String ${label}
${isMatching} = Run Keyword and Return Status Element Should Contain ${locator_to_check} ${labelTostring}
Log ${label}
Log ${isMatching}
Exit For Loop If '${isMatching}' == 'False'
END
I am getting the following output for this:
Element
'xpath=//*[#id="generalAndIncidents:generalAndIncidentsPanel"]' should
have contained text '['Benutzer', 'Passwort', 'Sendung',
'Transaktionen', 'Notiz']' but its text was.... (and it lists all the
text from my locator)
So, it is basically not checking the words one by one.
Am I doing something wrong here? Is this a bad approach I am trying to do here?
I would be grateful if anyone could provide me some hint on what I should do here instead!
Thank you very much!
You've made one small but crucial mistake - the variable in this line here:
FOR ${label} IN ${text_list_variable}
, should be accessed with #:
FOR ${label} IN #{text_list_variable}
The for-in loops in RF expect 1 or more arguments of the looped over values, and the # expands a list variable to its members.

"New API In version A.B.C" page in doxygen

There is a Doxygen option to specify when API appeared using \since tag, for example
///
/// Does foo
///
/// \since 1.5
///
void foo();
And it would appear in foo()'s documentation.
What I'm looking is a way to create automatically page that contains all API
appeared in 1.5 - i.e. list all API marked by \since 1.5 or probably
some other tag if available.
Edit: I tried to use \ingroup and create a group page containing all new API there and it works. But it moves description to this page, for example moves a new method from class definition to a page "New in 1.2.3" which isn't what I wanted.
You want to create an external reference to the current item, an \xrefitem:
\xrefitem version_change_1_0_0 "Since 1.0.0" "Changes in 1.0.0" ...
<key> <heading> <list title> <text>
All items that share the same <key> will be shown on a special generated page. The <heading> will be used to start a section at the place you're using \xrefitem, whereas <list title> will be used as a title for the resulting page (see remarks below). The text can be arbitrary.
The result you get is similar to the lists and appearances of\todo and \bug, and you can even think of \bug and \todo implemented as
\bug <text> = \xrefitem bug "Bug" "List of bugs" <text>
\todo <text> = \xrefitem todo "Todo" "List of todos" <text>
Unfortunately, the key cannot contain dots:
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
Therefore, you have to use an alias that takes (at least) two arguments, one for the label, and one for the actual text:
ALIASES += sinceversion{3}="\xrefitem version_changes\1 \"Since \2\" \"Changes in \2\" \3\n\n"
ALIASES += sinceversion{2}="\sinceversion{\1,\2,Introduced in this version.}"
If you never use dots, you can of course simplify the alias even more. This will give you two new commands:
\sinceversion{label, version}
\sinceversion{label, version, custom text}
In both cases, the label must only contain alphanumeric symbols, the version can be arbitrary. If you don't provide the custom text, "Introduced in this version" will be shown.
If there's a page with the identifier version_changes<label>, the list of changes will be added. Note that the \page's title will overwrite the title given by the \xrefitem, which can be handy for major releases.
Example
Here's an example of \sinceversion's usage. Note that you probably want to use another alias like ALIASES += since_vXYZ{1}="\sinceversion{X_Y_Z,X.Y.Z,\1}" if you document a lot of changes for version x.y.z:
Example code
/** Foos around.
* \sinceversion{001,0.0.1}
*/
void foo(){}
/** Bars around.
* \sinceversion{001,0.0.1}
* \sinceversion{002,0.0.2,Removed a memory leak}
*/
void bar(){}
/** \page version_changes002 Changes in 0.0.2
*
* We found several memory leaks and removed them
*/
List of version change pages
List of changes per version
List of changes per version with additional description
Appearance of changes in function documentation

ZOS: Create first member of dataset

I'm using ZOS with ISPF 7.1
I have allocated a dataset with the following information:
I'm trying to create the first member of this dataset through the Edit Entry Panel (it's option 2 on the menu):
But I always end up with a "Member not found" message.
I know this panel can edit members that already exist, but what is the correct way to create the first member of a dataset (without copying)?
ISPF Edit does not like a RECFM of U (undefined). So you can't do what you are asking with the library.
The message isn't correct, but I don't suppose people see it that often. You can report that to IBM (ask your Technical Support to raise a PMR). Then at some point in the future you'll have a warm feeling when you do the same thing and it produces an accurate message.
If you put members into that dataset with a "copy" and then try to get a member-selection list for Edit, you'll see a message that "Browse was substituted". This is the source of your first message. Recfm U causes the switch to Browse, you can't have a "new" member in Browse, so it looks for an old one, which isn't found.
If you genuinely want RECFM U, you're not going to be able to edit with ISPF.
If instead, from the LRECL and BLOCKSIZE, you wanted RECFM F (fixed-length records) then you'll need to delete and reallocate the dataset with F.
A good way to allocate a new library is to use 3.2 and firstly just list a similar existing library (leave the command area blank is how you do that, and enter the library name in the obvious place).
Then when you A for Allocate, it will "fill in" the parameters of the library you have just listed, and you can make any necessary changes.
Option 0 In ISPF Primary Option Menu is for PDF Environment settings.for example:
__ Allow empty member list
__ Allow empty member list (nomatch)
__ Empty member list for edit only
change them and test.
Got me 5 years to answer this one :D
Actually it's a very normal behavior. You created a PDS but there are any members inside. Simplest is to go to ISPF edit and in the dataset name type name of your dataset and in brackets the new member name - hlq.data.set.name(member01).

VIM syntax: conditional function coloring

I'm customizing the standard "c.vim" syntax file in order to tune the visualisation of my C code.
I would like to distinguish the color of the "called functions" from the one of the "declared functions".
Exemple:
int declared_function()
{
int m;
m = called_function();
return (m)
}
I read in depth the VIM documentation, and millions of forums and google results, but all the solutions I tried didn't work.
To resume, I did this:
I defined a region in a recursive way in order to consider all the code within the braces:
syn region Body start="{" end="}" contains=Body
Then I defined through VIM patterns a general function syntax:
syn match cFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine
I did this because I thought I could combine the two in a "if else" condition in the .vimrc file... but after a whole day of failing tests I need the help of someone, who can tell me if it's possible and how to do it.
Thanks everybody.
You're very close. First, you don't need the recursive definition, but contain all other top-level C syntax elements in it, plus the special group you'll define for called functions:
:syn region Body start="{" end="}" contains=TOP,cFunctionUse
Actually, scratch that, the default $VIMRUNTIME/syntax/c.vim already defines a cBlock syntax group.
Then, define a different syntax group that is contained in the cBlock group.
:syn match cFunctionUse "\<\h\w*\>\(\s\|\n\)*("me=e-1 contained containedin=cBlock contains=cType,cDelimiter,cDefine
Finally, link or define a different highlight group for it, so that it actually looks different:
:hi link cFunctionUse Special
You can put those into ~/.vim/after/syntax/c.vim, so that they'll be added automatically to the default C syntax.

Resources