From 853a536fc279e931277e2021aa9274edcd6328c4 Mon Sep 17 00:00:00 2001 From: gregfoss Date: Sat, 19 Oct 2019 17:01:43 -0400 Subject: [PATCH 1/2] Adding simple style guides --- breadcrumbs/doc/style/style.cpp | 20 ++++++++++++++++++++ breadcrumbs/doc/style/style.hpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 breadcrumbs/doc/style/style.cpp create mode 100644 breadcrumbs/doc/style/style.hpp diff --git a/breadcrumbs/doc/style/style.cpp b/breadcrumbs/doc/style/style.cpp new file mode 100644 index 0000000..26df8b9 --- /dev/null +++ b/breadcrumbs/doc/style/style.cpp @@ -0,0 +1,20 @@ +/* + +This file correspondes to style.hpp and is an example of +the .cpp files that would correspond to the .hpp file. + +*/ + + +#include "style.hpp" + + +char TestClass::attrTwoTimesTwo() +{ + return c_attrTwo << 1 +} + +int TestClass::getAttrSum() +{ + return c_attrTwo + i_attrOne +} diff --git a/breadcrumbs/doc/style/style.hpp b/breadcrumbs/doc/style/style.hpp new file mode 100644 index 0000000..3005889 --- /dev/null +++ b/breadcrumbs/doc/style/style.hpp @@ -0,0 +1,30 @@ +/* + +This file contains the style of each programming construct +to use in this project. + +It should be followed to the letter! All spaces are +necessary! Make sure to take not of camel case and other +variable naming schemes! + +*/ + +// Header File: +class TestClass +{ +public: + // Constructors + TestClass(int AttrOne, char AttrTwo); + // Mutator methods + int getAttrSum(); + char attrTwoTimesTwo(); + void setAttrOne(int newAttrOne) { i_attrOne = newAttrOne } + void setAttrTwo(char newAttrTwo) { c_attrTwo = newAttrTwo } + // Accessor methods + int getAttrOne() { return i_attrOne } + char getAttrTwo() { return c_attrTwo } +private: + // Private variables + int i_attrOne = 0; + char c_attrTwo; +}; \ No newline at end of file From c4bf594cb1697f7f1411618d88e6004eb4f890be Mon Sep 17 00:00:00 2001 From: Nathan A Shaw Date: Sun, 20 Oct 2019 01:25:53 -0400 Subject: [PATCH 2/2] Update style.hpp --- breadcrumbs/doc/style/style.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/breadcrumbs/doc/style/style.hpp b/breadcrumbs/doc/style/style.hpp index 3005889..a4b4c78 100644 --- a/breadcrumbs/doc/style/style.hpp +++ b/breadcrumbs/doc/style/style.hpp @@ -4,7 +4,7 @@ This file contains the style of each programming construct to use in this project. It should be followed to the letter! All spaces are -necessary! Make sure to take not of camel case and other +necessary! Make sure to take note of camel case and other variable naming schemes! */ @@ -27,4 +27,4 @@ private: // Private variables int i_attrOne = 0; char c_attrTwo; -}; \ No newline at end of file +};