|
My Project
|
Coding style in PoDoFo follows the following general rules:
MethodNames(), or private/protected methods names intended to be called outside the boundary of the current class through inheritance or class/method friendship (eg. ProtectedMethod(), FriendMethod());initOperation(). It may be common to have a public outer method MyMethod() that performs some validations first and subsequently calls a private or virtual protected inner method myMethod() that actually performs the task;variableName).Some language specific programming stylistic choices will be hard enforced, namely:
malloc/free, string formatting, etc.) shall be converted to equivalent modern C++ constructs/API calls, unless there's still no other modern C++ alternative (eg. scanf). Where possible new/delete semantics shall be replaced by use of smart pointers;m_ and s_ prefixes shall be used respectively for instance member and static fields/variables. For example m_Value or s_instance. No other Hungarian notation prefixes will be accepted;if (!ptr) or while (ptr) conditionals) shall be converted to check for nullptr, eg. if (ptr == nullptr) or while (ptr != nullptr);it++, unless the prefixed operator is necessary for the correctness of an algorithm or allows to shorten/optimize the code.It follows other lenient rules that are not truly enforced in all the code base, but that it is still recommended to follow:
m_privateField;m_Value.PdfDictionary and other methods doing lookups on PdfName with keys known at compile time: GetKey, FindKey, FindKeyHas, HasKey, RemoveKey methods (and in general non addition lookup methods) use string literals or string_view. For AddKey, AddKeyIndirect, AddKeyIndirectSafe use the "_n" user literalstd::string_view are always passed by const reference in the public APISome examples of expected coding style can be found at the following permalinks:
1.8.14