8000 mini-yaml/CONVENTIONS.md at dev · Renal-Of-Loon/mini-yaml · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
69 lines (46 loc) · 1.41 KB

CONVENTIONS.md

File metadata and controls

69 lines (46 loc) · 1.41 KB

Conventions

Coding and naming conventions for mini-yaml.

Code

All namespaces, enums, classes, methods, and variables are in lowercase and words are separated by underscore. Private and protected class variables are prefixed by "m_". Following code illustrates the coding style conventions for spacing, naming and ordering. Methods within a class may be grouped together by context, but should be in alphabetic order within each group.

namespace my_namespace {

    enum class my_enum {
        foo_bar,
        hello_word
    };

    class my_class {
    
      public: 
      
        static int my_static_func();
        ...
      
        my_class();
        my_class(const int value); 
        ...
        my_class(const my_class &);
        ~my_class();
      
        int method_1() const;
        int method_2() const;
        template<typename T>
        void method_3();
        ...
        
        my_class & operator = (const int &);
        my_class & operator += (const int &);
        my_class operator + (const int &) const;
        my_class operator - (const int &) const;
        ...
      
      protected:
      
        ...
      
      private:
      
        void private_method();
        ...
      
        int32_t m_foo;
        int32_t m_hello_world;
        ...
        
    };
    
}

namespace my_namespace {

    template<typename Tvalue>
    void my_class::method_3() {
        
    }
    
}
0