Atomineer:判断return类型是否为const

Atomineer: Determine if return type is const

我正在使用 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 说明对于 MethodReturns,使用 %type% 将提供完整的 return 类型(给出的示例是: 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)

然而,当我使用 %type% 时,它省略了 const。来自 MethodReturns.xml 的示例:

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

这将为该方法生成以下内容:

//! \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();

我尝试了所有其他变体:%typeBase(来自 MethodReturns.xml)甚至 %retTypeBase%%retType%%typeBase%%specialType%(在 Methods.xml 中记录方法时在确定 return 类型时提到了这些)但是 none 其中包括 const.

我还尝试了其他几种类型(doublestd::string 和自定义 structs),所以它不仅仅是 int.

从上面的例子可以看出,我已经验证了我设置的描述确实是被调用的描述。

此外,这似乎完全适用于 Parameters.xml(确定参数类型是否为 const);但是,它似乎在 Methods.xml 中不起作用(其中 %retType% 可用于确定带修饰符的 return 类型)

如何确定方法是否正在 returning const

这显然是 Atomineer 中的一个错误,并且在最新版本 (9.21.3.1510) 中仍然可以重现。正如在他们的规则和模板文档中所写的那样,MethodReturns.xml 中的 %type% 变量应该始终解析为完整类型(也包括 const-modifier)。那里的例子

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

甚至使用了 const 修饰符,应该解析为 (const int*) - 但不是。默认 MethodReturns.xml 没有任何修改,问题仍然存在(即使使用了 %retType% 文档中根本没有包含它 - 但它的行为仍然相同:没有 const文档中显示的修饰符)。

我建议通过他们网站上的电子邮件 (support@atomineerutils.com) 联系 Atomineer Pro 文档的支持,并向他们报告此问题。

抱歉@Tas - 这确实是 Atomineer 中的一个回归,我们在得知它的那天就修复了它。我没有注意到你的 post 在这里,否则我们会尽快解决问题。如果您以后有任何问题,请直接与我们联系(我们的电子邮件地址在 Atomineer website 上)以便我们尽快为您提供帮助。

(修复将在 v9.22 中,应该会很快发布)