Search code examples
c++atomineer

Atomineer: Determine if return type is const


I'm using Atomineer 9.00 to format my code comments, but I'm having difficulty trying to determine if a return type is const or not. The documentation states that for MethodReturns, using %type% will provide the full return type (the example given is: const int*):

MethodReturns

Rules used to generate the description for the return values for methods (VB functions). The following special variables can be used in this section:

%type% The return type for the method (const int*)
%typeBase% The return type for the method, not including any modifiers (int)

however, when I use %type% it omits the const. An example from MethodReturns.xml:

<Set desc="zzz A %type%" />

Which will produce the following for the method:

//! \brief  Performs the action.
//! \return zzz an int.
int PerformAction();

//! \brief  Performs the different action.
//! \return zzz an int.
const int PerformDifferentAction();

//! \brief  Practise action.
//! \return zzz A std::string&amp;
std::string& PractiseAction();

//! \brief  Attempt action.
//! \return zzz A std::string&amp;
const std::string& AttemptAction();

struct Success;

//! \brief  Performs the action with tips action.
//! \return zzz A success*.
Success* PerformActionWithTips();

//! \brief  Succeed at action.
//! \return zzz An int*.
const int* SucceedAtAction();

I've tried all other variations: %typeBase (from MethodReturns.xml) and even %retTypeBase%, %retType%, %typeBase% and %specialType% (these are mentioned in determining the return type when documenting a method in Methods.xml) but none of these include const.

I've also tried several other types (double, std::string and custom structs) so it isn't just int.

As you can see from the example above, I've verified that the description I'm setting is definitely the one being called.

Also, this seems to work completely fine with Parameters.xml (determine if a parameter type is const or not); however, it doesn't appear to work in Methods.xml (where %retType% can be used to determine the return type with modifiers)

How can I determine if a method is returning a const?


Solution

  • This is clearly a bug in Atomineer and still reproducable in the latest version (9.21.3.1510). As in their rules and templates documentation written the %type% variable inside of MethodReturns.xml should always resolve to the complete type (including const-modifier as well). The example there

    %type% The return type for the method (const int*)

    is even using a const modifier and should resolve to (const int*) - but isn't. The problem persists already with the default MethodReturns.xml without any modifications (even that there is %retType% used, which is not contained in the documentation at all - but it behaves same anyway: no const modifier shown in documentation).

    I would suggest to contact the support of Atomineer Pro Documentation via the e-Mail on their website ([email protected]) and report this issue to them.