doc/coding_style.dox
changeset 963 5a7556e9e340
parent 921 818510fa3d99
child 991 e619a466ca5d
equal deleted inserted replaced
7:9203a67c6213 8:44241f31f2b9
     9 functions, variables, constants and exceptions. If these conventions
     9 functions, variables, constants and exceptions. If these conventions
    10 are met in one's code then it is easier to read and maintain
    10 are met in one's code then it is easier to read and maintain
    11 it. Please comply with these conventions if you want to contribute
    11 it. Please comply with these conventions if you want to contribute
    12 developing LEMON library.
    12 developing LEMON library.
    13 
    13 
       
    14 \warning In some cases we diverge from these rules.
       
    15 This primary done because STL uses different naming convention and
       
    16 in certain cases
       
    17 it is beneficial to provide STL compatible interface.
       
    18 
       
    19 \subsection cs-files File Names
       
    20 
       
    21 The header file names should look like the following.
       
    22 
       
    23 \code
       
    24 header_file.h
       
    25 \endcode
       
    26 
       
    27 Note that all standard Lemon headers are located in the \c lemon subdirectory,
       
    28 so you should include them from C++ source like this:
       
    29 
       
    30 \code
       
    31 #include <lemon/header_file.h>
       
    32 \endcode
       
    33 
       
    34 The source code files use the same style and they have '.cc' extension.
       
    35 
       
    36 \code
       
    37 source_code.cc
       
    38 \endcode
       
    39 
    14 \subsection cs-class Classes and other types
    40 \subsection cs-class Classes and other types
    15 
    41 
    16 The name of a class or any type should look like the following:
    42 The name of a class or any type should look like the following.
    17 
    43 
    18 \code
    44 \code
    19 AllWordsCapitalizedWithoutUnderscores 
    45 AllWordsCapitalizedWithoutUnderscores 
    20 \endcode
    46 \endcode
    21 
    47 
    22 \subsection cs-func Methods and other functions
    48 \subsection cs-func Methods and other functions
    23 
    49 
    24 The name of a function should look like the following:
    50 The name of a function should look like the following.
    25 
    51 
    26 \code
    52 \code
    27 firstWordLowerCaseRestCapitalizedWithoutUnderscores 
    53 firstWordLowerCaseRestCapitalizedWithoutUnderscores 
    28 \endcode
    54 \endcode
    29 
    55 
    30 \subsection cs-funcs Constants, Macros
    56 \subsection cs-funcs Constants, Macros
    31 
    57 
    32 The names of constants and macros should look like the following:
    58 The names of constants and macros should look like the following.
    33 
    59 
    34 \code
    60 \code
    35 ALL_UPPER_CASE_WITH_UNDERSCORES 
    61 ALL_UPPER_CASE_WITH_UNDERSCORES 
    36 \endcode
    62 \endcode
    37 
    63 
    38 \subsection cs-loc-var Class and instance member variables, auto variables 
    64 \subsection cs-loc-var Class and instance member variables, auto variables 
    39 
    65 
    40 The names of class and instance member variables and auto variables (=variables used locally in methods) should look like the following:
    66 The names of class and instance member variables and auto variables (=variables used locally in methods) should look like the following.
    41 
    67 
    42 \code
    68 \code
    43 all_lower_case_with_underscores 
    69 all_lower_case_with_underscores 
    44 \endcode
    70 \endcode
    45 
    71 
    46 \subsection cs-excep Exceptions
    72 \subsection cs-excep Exceptions
    47 
    73 
    48 When writing exceptions please comply the following naming conventions:
    74 When writing exceptions please comply the following naming conventions.
    49 
    75 
    50 \code
    76 \code
    51 ClassNameEndsWithException
    77 ClassNameEndsWithException
    52 \endcode
    78 \endcode
    53 
    79 
    54 \warning In some cases we diverge from these rules.
       
    55 This primary done because STL uses different naming convention and
       
    56 in certain cases
       
    57 it is beneficial to provide STL compatible interface.
       
    58 
       
    59 */
    80 */