Remove trailing whitespace (#3668)

This commit is contained in:
John Vandenberg
2022-07-07 17:18:20 +08:00
committed by GitHub
parent 0af9524e16
commit 0e6e16645c
1330 changed files with 23570 additions and 23571 deletions

View File

@@ -34,7 +34,7 @@ class CppParser_API Attributes
public:
typedef std::map<std::string, std::string> AttrMap;
typedef AttrMap::const_iterator Iterator;
Attributes();
/// Creates the Attributes object.
@@ -46,15 +46,15 @@ public:
Attributes& operator = (const Attributes& attrs);
/// Assignment operator.
bool has(const std::string& name) const;
/// Returns true if an attribute with the given name exists.
std::string getString(const std::string& name) const;
/// Returns the attribute's value as a string.
///
/// Throws a Poco::NotFoundException if the attribute does not exist.
std::string getString(const std::string& name, const std::string& defaultValue) const;
/// Returns the attribute's value as a string, if it exists.
/// Returns the defaultValue if the attribute does not exist.
@@ -64,7 +64,7 @@ public:
///
/// Throws a Poco::NotFoundException if the attribute does not exist.
/// Throws a Poco::SyntaxException if the stored value is not an integer.
int getInt(const std::string& name, int defaultValue) const;
/// Returns the attribute's value as an integer, if it exists.
/// Returns the defaultValue if the attribute does not exist.
@@ -74,7 +74,7 @@ public:
bool getBool(const std::string& name) const;
/// Returns the attribute's value as a boolean.
/// The returned value is 'true', iff the stored value is not "false".
///
///
/// Throws a Poco::NotFoundException if the attribute does not exist.
bool getBool(const std::string& name, bool defaultValue) const;
@@ -83,17 +83,17 @@ public:
void set(const std::string& name, const std::string& value);
/// Sets the value of an attribute.
void remove(const std::string& name);
/// Removes the attribute with the given name.
/// Does nothing if the attribute does not exist.
const std::string& operator [] (const std::string& name) const;
std::string& operator [] (const std::string& name);
std::string& operator [] (const std::string& name);
Iterator begin() const;
Iterator end() const;
void clear();
/// Clears all attributes.

View File

@@ -34,13 +34,13 @@ class CppParser_API AttributesParser
/// structs/classes, functions, types, etc. can be annotated
/// with attributes.
///
/// Attributes always come immediately before the symbol that
/// Attributes always come immediately before the symbol that
/// is being annotated, and are written inside special comments
/// with the syntax:
/// //@ <attrDecl>[,<attrDec>...]
/// where <attrDecl> is
/// <name>[=<value>]
/// <name> is a valid C++ identifier, or two identifiers separated by
/// <name> is a valid C++ identifier, or two identifiers separated by
/// a period (struct accessor notation).
/// <value> is a string, integer, identifier, bool literal, or a complex value
/// in the form
@@ -67,7 +67,7 @@ protected:
static bool isOperator(const Poco::Token* pToken, int kind);
static bool isLiteral(const Poco::Token* pToken);
static bool isEOF(const Poco::Token* pToken);
private:
Attributes& _attrs;
Tokenizer _tokenizer;

View File

@@ -48,7 +48,7 @@ public:
FN_DEFAULT = 512, /// The function is default.
FN_DELETE = 1024 /// The function has been deleted.
};
typedef std::vector<Parameter*> Parameters;
typedef Parameters::const_iterator Iterator;
@@ -68,51 +68,51 @@ public:
Iterator end() const;
/// Returns an iterator for iterating over the Function's Parameter's.
void makeInline();
/// Sets the FN_INLINE flag.
void makeConst();
/// Sets the FN_CONST flag.
void makePureVirtual();
/// Sets the FN_PURE_VIRTUAL flag.
void makeFinal();
/// Sets the FN_FINAL flag.
void makeOverride();
/// Sets the FN_OVERRIDE flag.
void makeNoexcept();
/// Sets the FN_NOEXCEPT flag.
void makeDefault();
/// Sets the FN_DEFAULT flag.
void makeDelete();
/// Sets the FN_DELETE flag.
int flags() const;
/// Returns the function's flags.
bool isConstructor() const;
/// Returns true iff the function is a constructor.
bool isDestructor() const;
/// Returns true iff the function is a destructor.
bool isMethod() const;
/// Returns true iff the function is a method (it's part of
/// a Struct and it's neither a constructor nor a destructor).
bool isFunction() const;
/// Returns true iff the function is not a member of a class
/// (a freestanding function).
bool isConst() const;
/// Returns true iff the method is const.
bool isDefault() const;
/// Returns true iff the method has a default implementation.
@@ -121,20 +121,20 @@ public:
int countParameters() const;
/// Returns the number of parameters.
std::string signature() const;
/// Returns the signature of the function.
bool isVirtual() const;
/// Returns true if the method is virtual. Also examines base
/// classes to check for a virtual function with the same
/// signature.
Function* getOverridden() const;
/// If the function is virtual and overrides a function in a
/// base class, the base class function is returned.
/// Otherwise, null is returned.
Symbol::Kind kind() const;
std::string toString() const;

View File

@@ -37,7 +37,7 @@ public:
typedef SymbolTable::const_iterator Iterator;
typedef std::map<std::string, std::string> AliasMap;
typedef std::vector<std::string> NameSpaceVec;
NameSpace();
/// Creates the NameSpace.
@@ -46,56 +46,56 @@ public:
~NameSpace();
/// Destroys the NameSpace.
void addSymbol(Symbol* pSymbol);
/// Adds a symbol to the namespace.
void importSymbol(const std::string& fullName);
/// Imports a symbol from another namespace (using <symbol>).
void importNameSpace(const std::string& nameSpace);
/// Imports a namespace (using namespace <namespace>).
Iterator begin() const;
/// Returns an iterator for iterating over the NameSpace's Symbol's.
Iterator end() const;
/// Returns an iterator for iterating over the NameSpace's Symbol's.
Symbol* lookup(const std::string& name) const;
/// Looks up the given name in the symbol table
/// and returns the corresponding symbol, or null
/// if no symbol can be found. The name can include
/// a namespace.
static NameSpace* root();
/// Returns the root namespace. Never delete this one!
void nameSpaces(SymbolTable& table) const;
/// Fills the symbol table with all namespaces.
void typeDefs(SymbolTable& table) const;
/// Fills the symbol table with all type definitions.
void typeAliases(SymbolTable& table) const;
/// Fills the symbol table with all type alias (using) definitions.
void enums(SymbolTable& table) const;
/// Fills the symbol table with all enums.
void classes(SymbolTable& table) const;
/// Fills the symbol table with all classes and structs.
void functions(SymbolTable& table) const;
/// Fills the symbol table with all functions.
void variables(SymbolTable& table) const;
/// Fills the symbol table with all variables.
const AliasMap& importedSymbols() const;
/// Returns a const reference to a SymbolTable containing all
/// imported symbols.
const NameSpaceVec& importedNameSpaces() const;
/// Returns a vector containing all imported namespaces.
@@ -128,7 +128,7 @@ inline const NameSpace::AliasMap& NameSpace::importedSymbols() const
return _importedSymbols;
}
inline const NameSpace::NameSpaceVec& NameSpace::importedNameSpaces() const
{
return _importedNameSpaces;

View File

@@ -82,7 +82,7 @@ protected:
const Poco::Token* parseClassMembers(const Poco::Token* pNext, Struct* pClass);
const Poco::Token* parseAccess(const Poco::Token* pNext);
const Poco::Token* parseIdentifier(const Poco::Token* pNext, std::string& id);
void addSymbol(Symbol* pSymbol, int lineNumber, bool addGST = true);
void pushNameSpace(NameSpace* pNameSpace, int lineNumber, bool addGST = true);
void popNameSpace();

View File

@@ -42,7 +42,7 @@ public:
FN_TEMPLATE_SPECIALIZATION = 4,
FN_FINAL = 8
};
struct Base
{
Symbol::Access access;
@@ -50,7 +50,7 @@ public:
std::string name;
Struct* pClass;
};
typedef std::vector<Base> BaseClasses;
typedef BaseClasses::const_iterator BaseIterator;
typedef std::vector<Struct*> StructVec;
@@ -67,13 +67,13 @@ public:
void addBase(const std::string&, Symbol::Access access, bool isVirtual);
/// Adds a base class.
BaseIterator baseBegin() const;
/// Returns an iterator for iterating over all base classes.
BaseIterator baseEnd() const;
/// Returns an iterator for iterating over all base classes.
void fixupBases();
/// Adds pointers for all base classes.
@@ -88,13 +88,13 @@ public:
const std::string& declaration() const;
/// Returns the declaration.
int flags() const;
/// Returns the struct's flags.
void makeInline();
/// Changes the class to a inline class, i.e. definition and implementation are hidden in a cpp file.
void makeFinal();
/// Makes the class final.
@@ -106,39 +106,39 @@ public:
void constructors(Functions& functions) const;
/// Returns all constructors, sorted by their parameter count.
Function* destructor() const;
/// Returns the destructor, or NULL if no
/// destructor is defined.
void methods(Symbol::Access access, Functions& functions) const;
/// Returns all functions with the given access.
void inheritedMethods(FunctionSet& functions) const;
/// Returns all inherited methods.
void bases(std::set<std::string>& bases) const;
/// Returns all base classes.
void derived(StructSet& derived) const;
/// Returns all derived classes.
/// Returns all derived classes.
Function* findFunction(const std::string& signature) const;
/// Finds a function with the given signature.
bool hasVirtualDestructor() const;
/// Returns true if the class CppParser_API or one if its base classes
/// has a virtual destructor.
bool isClass() const;
/// Returns true iff the struct was declared as class.
bool isDerived() const;
/// Returns true iff the struct or class is derived from another struct or class.
Symbol::Kind kind() const;
std::string toString() const;
private:
std::string _decl;
BaseClasses _bases;

View File

@@ -37,9 +37,9 @@ public:
public:
std::string beginNameSpaceDecl; // contains either $(NS)_BEGIN or the namespace x { decl
std::string endNameSpaceDecl; // contains either $(NS)_END or the closing brackets }
std::vector<std::string> classDecls; // contains strings of the form "class X;"
std::vector<std::string> classDecls; // contains strings of the form "class X;"
};
static void parse(const std::string& file, NameSpace::SymbolTable& st, const std::string& exec, const std::string& options, const std::string& path);
/// Preprocesses and parses the file. The resulting symboltable has base class references already fixed,

View File

@@ -37,13 +37,13 @@ public:
VAR_VOLATILE = 4, /// The variable is volatile.
VAR_CONST = 8 /// The variable is const.
};
Variable(const std::string& decl, NameSpace* pNameSpace);
/// Creates the Variable.
~Variable();
/// Destroys the Variable.
int flags() const;
/// Returns the variable's flags.
@@ -57,7 +57,7 @@ public:
///
/// Example: a type const std::string& -> std::string, a type const std::string* returns std::string
private:
int _flags;
bool _isPointer;