Kaynağa Gözat

Move things into a proper include/$project directory.

Sam Jaffe 4 yıl önce
ebeveyn
işleme
a140df87a4

+ 4 - 26
dice-roll.xcodeproj/project.pbxproj

@@ -105,20 +105,16 @@
 		CD38F53621C89493007A732C /* exception.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = exception.cxx; sourceTree = "<group>"; };
 		CD38F53821C922E2007A732C /* roll_test.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = roll_test.cxx; sourceTree = "<group>"; };
 		CD38F53A21C928B4007A732C /* exception_test.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = exception_test.cxx; sourceTree = "<group>"; };
-		CD38F54D21C945C2007A732C /* terminal_helper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = terminal_helper.h; sourceTree = "<group>"; };
 		CD38F54E21C945C2007A732C /* terminal_helper.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = terminal_helper.cxx; sourceTree = "<group>"; };
 		CD38F55421C9482A007A732C /* stateful_dice */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = stateful_dice; sourceTree = BUILT_PRODUCTS_DIR; };
 		CD38F55621C9482A007A732C /* main.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cxx; sourceTree = "<group>"; };
-		CD8F1ABC21B31E9E00CBB3CA /* roll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = roll.h; sourceTree = "<group>"; };
 		CD8F1ABD21B31E9E00CBB3CA /* roll.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = roll.cxx; sourceTree = "<group>"; };
 		CDC7488C25312DBF008D9D1D /* GoogleMock.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GoogleMock.xcodeproj; path = "../../../gmock-xcode-master/GoogleMock.xcodeproj"; sourceTree = "<group>"; };
 		CDED6A2321B2F28A00AB91D0 /* simple_dice */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = simple_dice; sourceTree = BUILT_PRODUCTS_DIR; };
 		CDED6A2621B2F28A00AB91D0 /* main.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cxx; sourceTree = "<group>"; };
-		CDED6A2F21B2F2DC00AB91D0 /* die.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = die.h; sourceTree = "<group>"; };
 		CDED6A3021B2F2DC00AB91D0 /* die.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = die.cxx; sourceTree = "<group>"; };
-		CDED6A5821B2F6E800AB91D0 /* random.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = random.h; sourceTree = "<group>"; };
 		CDED6A6021B2F89900AB91D0 /* libshared_random_generator.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libshared_random_generator.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
-		CDF88B9C21B304EF004BAB50 /* exception.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = "<group>"; };
+		CDEE78D225B333A700F195F9 /* dice-roll */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "dice-roll"; path = "include/dice-roll"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -197,7 +193,7 @@
 			isa = PBXGroup;
 			children = (
 				CDC7488C25312DBF008D9D1D /* GoogleMock.xcodeproj */,
-				CDED6A2E21B2F2C300AB91D0 /* include */,
+				CDEE78D225B333A700F195F9 /* dice-roll */,
 				CDED6A2D21B2F2B200AB91D0 /* test */,
 				CDED6A2521B2F28A00AB91D0 /* src */,
 				CD38F52721C87771007A732C /* dice-td */,
@@ -222,7 +218,6 @@
 		CDED6A2521B2F28A00AB91D0 /* src */ = {
 			isa = PBXGroup;
 			children = (
-				CD38F54D21C945C2007A732C /* terminal_helper.h */,
 				CD38F54E21C945C2007A732C /* terminal_helper.cxx */,
 				CDED6A3021B2F2DC00AB91D0 /* die.cxx */,
 				CD38F53621C89493007A732C /* exception.cxx */,
@@ -241,17 +236,6 @@
 			path = test;
 			sourceTree = "<group>";
 		};
-		CDED6A2E21B2F2C300AB91D0 /* include */ = {
-			isa = PBXGroup;
-			children = (
-				CDED6A2F21B2F2DC00AB91D0 /* die.h */,
-				CDF88B9C21B304EF004BAB50 /* exception.h */,
-				CDED6A5821B2F6E800AB91D0 /* random.h */,
-				CD8F1ABC21B31E9E00CBB3CA /* roll.h */,
-			);
-			path = include;
-			sourceTree = "<group>";
-		};
 		CDED6A5F21B2F89900AB91D0 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
@@ -629,10 +613,7 @@
 				MTL_FAST_MATH = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = macosx;
-				USER_HEADER_SEARCH_PATHS = (
-					"$(PROJECT_DIR)/include/",
-					"$(PROJECT_DIR)/src/",
-				);
+				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/include/";
 			};
 			name = Debug;
 		};
@@ -689,10 +670,7 @@
 				MTL_ENABLE_DEBUG_INFO = NO;
 				MTL_FAST_MATH = YES;
 				SDKROOT = macosx;
-				USER_HEADER_SEARCH_PATHS = (
-					"$(PROJECT_DIR)/include/",
-					"$(PROJECT_DIR)/src/",
-				);
+				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/include/";
 			};
 			name = Release;
 		};

include/die.h → include/dice-roll/die.h


include/exception.h → include/dice-roll/exception.h


include/random.h → include/dice-roll/random.h


include/roll.h → include/dice-roll/roll.h


src/terminal_helper.h → include/dice-roll/terminal_helper.h


+ 3 - 3
simple_dice/main.cxx

@@ -6,11 +6,11 @@
 //  Copyright © 2018 Sam Jaffe. All rights reserved.
 //
 
-#include "exception.h"
-#include "terminal_helper.h"
-
 #include <iostream>
 
+#include "dice-roll/exception.h"
+#include "dice-roll/terminal_helper.h"
+
 void eval(std::string const & str) {
   try {
     terminal::process_dice_string(str);

+ 3 - 2
src/die.cxx

@@ -6,12 +6,13 @@
 //  Copyright © 2018 Sam Jaffe. All rights reserved.
 //
 
-#include "die.h"
-#include "exception.h"
+#include "dice-roll/die.h"
 
 #include <iostream>
 #include <sstream>
 
+#include "dice-roll/exception.h"
+
 static void advance_over_whitespace(std::istream & in, char const * also = "") {
   if (strchr(also, in.peek())) { in.get(); }
   while (isspace(in.peek())) {

+ 1 - 1
src/exception.cxx

@@ -6,7 +6,7 @@
 //  Copyright © 2018 Sam Jaffe. All rights reserved.
 //
 
-#include "exception.h"
+#include "dice-roll/exception.h"
 
 #include <cmath>
 #include <string>

+ 2 - 2
src/roll.cxx

@@ -6,13 +6,13 @@
 //  Copyright © 2018 Sam Jaffe. All rights reserved.
 //
 
-#include "roll.h"
+#include "dice-roll/roll.h"
 
 #include <iostream>
 #include <memory>
 #include <numeric>
 
-#include "random.h"
+#include "dice-roll/random.h"
 
 namespace dice {
   die_roll::operator int() const {

+ 5 - 5
src/terminal_helper.cxx

@@ -6,14 +6,14 @@
 //  Copyright © 2018 Sam Jaffe. All rights reserved.
 //
 
-#include "terminal_helper.h"
-
-#include "die.h"
-#include "exception.h"
-#include "roll.h"
+#include "dice-roll/terminal_helper.h"
 
 #include <iostream>
 
+#include "dice-roll/die.h"
+#include "dice-roll/exception.h"
+#include "dice-roll/roll.h"
+
 namespace terminal { namespace {
   void print(dice::dice_roll const & r) {
     std::cout << int(r) << " (" << r << ")\n";

+ 3 - 3
stateful_dice/main.cxx

@@ -6,14 +6,14 @@
 //  Copyright © 2018 Sam Jaffe. All rights reserved.
 //
 
-#include "exception.h"
-#include "terminal_helper.h"
-
 #include <fstream>
 #include <iostream>
 #include <map>
 #include <regex>
 
+#include "dice-roll/exception.h"
+#include "dice-roll/terminal_helper.h"
+
 void usage() {
   std::cout << "'help'      : Print this message\n";
   std::cout << "'A := Dice' : Create a substitution pattern\n";

+ 4 - 4
test/dice_test.cxx

@@ -6,12 +6,12 @@
 //  Copyright © 2018 Sam Jaffe. All rights reserved.
 //
 
-#include <gmock/gmock.h>
+#include <sstream>
 
-#include "die.h"
-#include "exception.h"
+#include <gmock/gmock.h>
 
-#include <sstream>
+#include "dice-roll/die.h"
+#include "dice-roll/exception.h"
 
 using unsigned_die = std::pair<int, int>;
 namespace dice {

+ 2 - 2
test/exception_test.cxx

@@ -8,8 +8,8 @@
 
 #include <gmock/gmock.h>
 
-#include "die.h"
-#include "exception.h"
+#include "dice-roll/die.h"
+#include "dice-roll/exception.h"
 
 using namespace ::testing;
 

+ 2 - 2
test/roll_test.cxx

@@ -11,8 +11,8 @@
 
 #include "shared_random_generator/random_impl.h"
 
-#include "die.h"
-#include "roll.h"
+#include "dice-roll/die.h"
+#include "dice-roll/roll.h"
 
 struct MockRandomImpl : public engine::detail::random_impl {
   MOCK_METHOD1(exclusive, unsigned int(unsigned int));