Commits

Billy O'Neal committed 7b25c98 Merge

Merged in code changes from README change.

  • Participants
  • Parent commits df4cc9d, e265306

Comments (0)

Files changed (8)

File pevLib/fileData.h

 	};
 	mutable std::vector<LANGANDCODEPAGE> versionTranslations;
 
-	//Hex managment 
+	//Hex management 
 	std::tr1::shared_ptr<std::vector<std::pair<unsigned int, bool> > > hexStorage;
 
 	//Enumeration functions

File pevLib/pevLib.vcxproj

     <ClInclude Include="reportComponents.hpp" />
     <ClInclude Include="rexport.h" />
     <ClInclude Include="serviceControl.h" />
+    <ClInclude Include="stlUtil.hpp" />
     <ClInclude Include="timeoutThread.h" />
     <ClInclude Include="times.h" />
     <ClInclude Include="unzip.h" />

File pevLib/pevLib.vcxproj.filters

     <ClInclude Include="reportComponents.hpp">
       <Filter>Source Files</Filter>
     </ClInclude>
+    <ClInclude Include="stlUtil.hpp">
+      <Filter>Source Files</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>

File pevLib/reportAssembler.cpp

 //          http://www.boost.org/LICENSE_1_0.txt)
 //
 #include "pch.hpp"
+#include "stlUtil.hpp"
+#include "reportAssembler.hpp"
+
+namespace vFind {
+
+void QueryChain::Install( std::auto_ptr<IInputProvider> newInput )
+{
+	inputs.push_back(newInput.get());
+	newInput.release();
+}
+
+void QueryChain::Install( std::auto_ptr<IFilter> newFilter )
+{
+	filters.push_back(newFilter.get());
+	newFilter.release();
+}
+
+void QueryChain::Install( std::auto_ptr<IOutput> newOutput )
+{
+	outputs.push_back(newOutput.get());
+	newOutput.release();
+}
+
+QueryChain::~QueryChain()
+{
+	std::for_each(inputs.begin(), inputs.end(), Deleter<IInputProvider *>());
+	std::for_each(filters.begin(), filters.end(), Deleter<IFilter *>());
+	std::for_each(outputs.begin(), outputs.end(), Deleter<IOutput *>());
+}
+
+void QueryChain::Run()
+{
+	for (std::vector<IInputProvider*>::iterator it = inputs.begin(), end = inputs.end();
+		it != end; ++it)
+	{
+		RunInput(**it);
+	}
+}
+
+void QueryChain::RunInput( IInputProvider& provider )
+{
+
+}
+
+}

File pevLib/reportAssembler.hpp

 //          http://www.boost.org/LICENSE_1_0.txt)
 //
 #pragma once
+#include "reportComponents.hpp"
 
+namespace vFind
+{
+
+class QueryChain
+{
+	std::vector<IInputProvider*> inputs;
+	std::vector<IFilter* > filters;
+	std::vector<IOutput* > outputs;
+
+	void RunInput(IInputProvider&);
+
+public:
+	~QueryChain();
+
+	void Install(std::auto_ptr<IInputProvider> newInput);
+	void Install(std::auto_ptr<IFilter> newFilter);
+	void Install(std::auto_ptr<IOutput> newOutput);
+
+	void Run();
+};
+
+}

File pevLib/reportComponents.cpp

 
 namespace vFind {
 
+std::vector<FileData> IFilter::Results()
+{
+	return std::vector<FileData>();
+}
 
-	std::vector<FileData> IFilter::Results()
-	{
-		return std::vector<FileData>();
-	}
+
+FileInput::FileInput( const std::wstring& rootPath )
+{
+	hSearch = FindFirstFile(rootPath.c_str(), &data);
+}
 
 }

File pevLib/reportComponents.hpp

 
 class FileInput : public IInputProvider
 {
-	std::wstring root;
+	WIN32_FIND_DATAW data;
 	HANDLE hSearch;
 public:
-	FileInput(const std::wstring& rootPath) : root(rootPath), hSearch(0) {}
+	FileInput(const std::wstring& rootPath);
 	~FileInput();
 	virtual FileData Next();
 };
 	virtual std::vector<FileData> Results();
 };
 
+class SortingFilter : public IFilter
+{
+
+};
+
+struct IOutput
+{
+	virtual ~IOutput() {};
+	virtual void Write(const FileData&) = 0;
+};
+
+class ConsoleOutput : public IOutput
+{
+public:
+	virtual void Write(const FileData&);
+};
+
+class ProcessKillOutput : public IOutput
+{
+public:
+	virtual void Write(const FileData&);
+};
+
 }

File pevLib/stlUtil.hpp

+//          Copyright Billy O'Neal 2011
+// Distributed under the Boost Software License, Version 1.0.
+//    (See accompanying file LICENSE_1_0.txt or copy at
+//          http://www.boost.org/LICENSE_1_0.txt)
+//
+#pragma once
+#include <funtional>
+
+template <typename T>
+struct Deleter : public std::unary_function<void, T>
+{
+	void operator()(T t)
+	{
+		delete t;
+	}
+};