diff --git a/Code/Misc/Misc.vcxproj b/Code/Misc/Misc.vcxproj index 58c71f07..3adbb7c8 100644 --- a/Code/Misc/Misc.vcxproj +++ b/Code/Misc/Misc.vcxproj @@ -69,21 +69,29 @@ $(SolutionDir)..\External\Lib\$(ProjectName)\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D + C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) + C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath) $(SolutionDir)..\External\Lib\$(ProjectName)\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) + C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) + C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath) $(SolutionDir)..\External\Lib\$(ProjectName)\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D + C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) + C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath) $(SolutionDir)..\External\Lib\$(ProjectName)\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) + C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) + C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath) @@ -138,10 +146,16 @@ + + + + + + diff --git a/Code/Misc/Misc.vcxproj.filters b/Code/Misc/Misc.vcxproj.filters index 6f633e1d..03a248f4 100644 --- a/Code/Misc/Misc.vcxproj.filters +++ b/Code/Misc/Misc.vcxproj.filters @@ -21,6 +21,15 @@ Source Files + + Source Files + + + Source Files + + + Source Files + @@ -32,5 +41,14 @@ Header Files + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file diff --git a/Code/Misc/Resource/Loaders/Textloader.cpp b/Code/Misc/Resource/Loaders/Textloader.cpp new file mode 100644 index 00000000..b42891cc --- /dev/null +++ b/Code/Misc/Resource/Loaders/Textloader.cpp @@ -0,0 +1,156 @@ + +#include "..\OResource.h" +#include "..\..\Utilities.h" + +#include + +using namespace Oyster::Resource; +bool readANSI = false; + + + +bool ReadFromFile(const wchar_t fileName[], const wchar_t openFlag[], std::wstring& outData, size_t elemSize) +{ + size_t bytesTotal = 0; + size_t bytesRead = 0; + FILE *stream; + + if( _wfopen_s( &stream, fileName, openFlag ) == 0 ) + { + //Get size of the file + fseek(stream, 0L, SEEK_END); + bytesTotal = ftell(stream); + fseek(stream, 0L, SEEK_SET); + + //Sanity check + if(bytesTotal == 0) return false; + + //Create the new byte buffer + wchar_t *buff = new wchar_t[bytesTotal + 1]; + + //Read the bytes to the end + bytesRead = fread_s( buff, bytesTotal, elemSize, bytesTotal ,stream ); + fclose( stream ); + + //Did we read enough bytes + if(!readANSI && bytesRead != bytesTotal) return false; + + //Add delimiter + buff[bytesRead] = L'\0'; + + outData.resize(bytesTotal); + outData = buff; + + delete [] buff; + } + else + { + std::wstring msg = L"Failed to open file: \n"; + msg.append(fileName); + + return false; + } + + return true; +} +bool ReadFromFile(const wchar_t fileName[], const char openFlag[], std::string& outData, size_t elemSize) +{ + std::string sFilename; + std::wstring wsFile = fileName; + ::Utility::String::WStringToString(wsFile, sFilename); + size_t bytesTotal = 0; + size_t bytesRead = 0; + FILE *stream; + + if( fopen_s( &stream, sFilename.c_str(), openFlag ) == 0 ) + { + //Get size of the file + fseek(stream, 0L, SEEK_END); + bytesTotal = ftell(stream); + fseek(stream, 0L, SEEK_SET); + fflush(stream); + + //Sanity check + if(bytesTotal == 0) return false; + + //Create the new byte buffer + char *buff = new char[bytesTotal + 1]; + + //Read the bytes to the end + bytesRead = fread_s( buff, bytesTotal, elemSize, bytesTotal ,stream ); + fclose( stream ); + + //Did we read enough bytes (Get the bytes if we read with ANSI since the hidden characters is ignored) + if(!readANSI && bytesRead != bytesTotal) return false; + + buff[bytesRead + 1]; + + outData.clear(); + outData.resize(bytesRead); + memcpy(&outData[0], &buff[0], bytesRead); + + delete [] buff; + } + else + { + std::string msg = "Failed to open file: \n"; + msg.append(sFilename.c_str()); + + return false; + } + + return true; +} + + +OResource* OResource::ByteLoader(const wchar_t filename[], ResourceType type) +{ + OResource *resource = 0; + std::wstring wOut; + std::string sOut; + bool success = false; + + switch (type) + { + case Oyster::Resource::ResourceType_UNKNOWN: + case Oyster::Resource::ResourceType_Byte_Raw: + success = ReadFromFile(filename, "rb", sOut, sizeof(char)); + break; + + case Oyster::Resource::ResourceType_Byte_ANSI: + readANSI = true; + success = ReadFromFile(filename, "r", sOut, sizeof(char)); + readANSI = false; + break; + + case Oyster::Resource::ResourceType_Byte_UTF8: + success = ReadFromFile(filename, "r, ccs=UTF-8", sOut, sizeof(char)); + break; + + case Oyster::Resource::ResourceType_Byte_UNICODE: + success = ReadFromFile(filename, "r, ccs=UNICODE", sOut, sizeof(char)); + break; + + case Oyster::Resource::ResourceType_Byte_UTF16LE: + success = ReadFromFile(filename, "r, ccs=UTF-16LE", sOut, sizeof(char)); + break; + } + + if(!success) return 0; + if(wOut.size()) + { + //const wchar_t *data = new wchar_t[wOut.size()]; + //resource = new OResource((void*)data, type, (sizeof(wchar_t) * wOut.size()), sizeof(wchar_t), filename); + } + else if(sOut.size()) + { + char *data = new char[sOut.size()+1]; + data[sOut.size()] = '\0'; + memcpy(&data[0], &sOut[0], sOut.size()); + resource = new OResource((OHRESOURCE)data, type, (sizeof(char) * sOut.size()), sizeof(char), filename); + + } + return resource; +} + + diff --git a/Code/Misc/Resource/OResource.cpp b/Code/Misc/Resource/OResource.cpp new file mode 100644 index 00000000..9bd9e83b --- /dev/null +++ b/Code/Misc/Resource/OResource.cpp @@ -0,0 +1,64 @@ +#include "OResource.h" + +using namespace Oyster::Resource; + +OResource::OResource(OHRESOURCE handle, ResourceType type, size_t resourceSize, size_t elementSize, ::std::wstring filename) + : resourceData (handle) + , resourceFilename (filename) + , resourceSize (resourceSize) + , resourceElementSize (elementSize) + , resourceType (type) +{ + +} +OResource::~OResource() +{} + +bool OResource::Release() +{ + if(this->resourceRef.Decref() == 0) + { + Remove(this->resourceType, this->resourceData); + return true; + } + return false; +} + +void OResource::Remove(ResourceType t, OHRESOURCE& r) +{ + switch (t) + { + case Oyster::Resource::ResourceType_Texture_PNG: + case Oyster::Resource::ResourceType_Texture_DDS: + case Oyster::Resource::ResourceType_Texture_JPG: + + break; + + case Oyster::Resource::ResourceType_Mesh_VertexData: + case Oyster::Resource::ResourceType_Mesh_AnimationData: + + break; + + case Oyster::Resource::ResourceType_Audio_mp3: + + break; + + case Oyster::Resource::ResourceType_Shader_Vertex: + case Oyster::Resource::ResourceType_Shader_Hull: + case Oyster::Resource::ResourceType_Shader_Domain: + case Oyster::Resource::ResourceType_Shader_Geometry: + case Oyster::Resource::ResourceType_Shader_Pixel: + case Oyster::Resource::ResourceType_Shader_Compute: + + break; + + case Oyster::Resource::ResourceType_UNKNOWN: + case Oyster::Resource::ResourceType_Byte_Raw: + case Oyster::Resource::ResourceType_Byte_ANSI: + case Oyster::Resource::ResourceType_Byte_UTF8: + case Oyster::Resource::ResourceType_Byte_UNICODE: + case Oyster::Resource::ResourceType_Byte_UTF16LE: + delete ((char*)r); + break; + } +} \ No newline at end of file diff --git a/Code/Misc/Resource/OResource.h b/Code/Misc/Resource/OResource.h new file mode 100644 index 00000000..e9af19b0 --- /dev/null +++ b/Code/Misc/Resource/OResource.h @@ -0,0 +1,60 @@ +///////////////////////////////////////////////////////////////////// +// Created by [Dennis Andersen] [2013] +///////////////////////////////////////////////////////////////////// + +#ifndef MISC_O_RESOURCE_H +#define MISC_O_RESOURCE_H + +#include "..\Utilities.h" +#include "OysterResource.h" +#include + +namespace Oyster +{ + namespace Resource + { + class OResource + { + public: + OResource(OHRESOURCE handle, ResourceType type, size_t size, size_t elementSize, ::std::wstring resourceFilename); + virtual~ OResource(); + bool Release(); + + inline ResourceType GetResourceType() const + { return this->resourceType; } + inline const wchar_t* GetResourceFilename() const + { return this->resourceFilename.c_str(); } + inline OHRESOURCE GetResourceHandle() const + { return this->resourceData; } + inline unsigned long long GetResourceSize() const + { return this->resourceSize; } + inline unsigned long long GetResourceElementSize() const + { return this->resourceElementSize; } + inline unsigned int GetResourceID() const + { return this->resourceID; } + inline void SetResourceID(unsigned int id) + { this->resourceID = id; } + + public: + static OResource* TextureLoader (const wchar_t filename[], ResourceType type) {return 0;} + static OResource* MeshLoader (const wchar_t filename[], ResourceType type) {return 0;}; + static OResource* AudioLoader (const wchar_t filename[], ResourceType type) {return 0;}; + static OResource* ShaderLoader (const wchar_t filename[], ResourceType type) {return 0;}; + static OResource* ByteLoader (const wchar_t filename[], ResourceType type); + + Utility::DynamicMemory::RefCount resourceRef; + + private: + static void Remove (ResourceType t, OHRESOURCE& r); + + OHRESOURCE resourceData; + ResourceType resourceType; + size_t resourceSize; + size_t resourceElementSize; + ::std::wstring resourceFilename; + unsigned int resourceID; + }; + } +} + +#endif \ No newline at end of file diff --git a/Code/Misc/Resource/OResourceHandler.cpp b/Code/Misc/Resource/OResourceHandler.cpp new file mode 100644 index 00000000..3db14dfb --- /dev/null +++ b/Code/Misc/Resource/OResourceHandler.cpp @@ -0,0 +1,182 @@ +///////////////////////////////////////////////////////////////////// +// Created by [Dennis Andersen] [2013] +///////////////////////////////////////////////////////////////////// + + +#include "OysterResource.h" +#include "OResource.h" +#include +#include + +using namespace Oyster::Resource; + +class ResourcePrivate +{ +public: + + std::map resources; + + OResource* FindResource(const OHRESOURCE& h) const; + OResource* FindResource(const wchar_t c[]) const; + void SaveResource(OResource* r, bool addNew = true); + +} resourcePrivate; + + +void IResourceHandler::Release() +{ + IResourceHandler::Clean(); +} +void IResourceHandler::Clean() +{ + auto i = resourcePrivate.resources.begin(); + auto last = resourcePrivate.resources.end(); + + for (i; i != last; i++) + { + if(i->second->Release()) + { + const wchar_t* temp = i->second->GetResourceFilename(); + delete resourcePrivate.resources[temp]; + resourcePrivate.resources.erase(temp); + } + } +} +OHRESOURCE IResourceHandler::LoadResource(const wchar_t* filename, ResourceType type, bool force) +{ + OResource *resourceData = resourcePrivate.FindResource(filename); + if(resourceData) + { + resourcePrivate.SaveResource(resourceData, false); + return resourceData->GetResourceHandle(); + } + + switch (type) + { + case Oyster::Resource::ResourceType_Texture_PNG: + case Oyster::Resource::ResourceType_Texture_DDS: + case Oyster::Resource::ResourceType_Texture_JPG: + resourceData = OResource::TextureLoader(filename, type); + break; + + case Oyster::Resource::ResourceType_Mesh_VertexData: + case Oyster::Resource::ResourceType_Mesh_AnimationData: + resourceData = OResource::MeshLoader(filename, type); + break; + + case Oyster::Resource::ResourceType_Audio_mp3: + resourceData = OResource::AudioLoader(filename, type); + break; + + case Oyster::Resource::ResourceType_Shader_Vertex: + case Oyster::Resource::ResourceType_Shader_Hull: + case Oyster::Resource::ResourceType_Shader_Domain: + case Oyster::Resource::ResourceType_Shader_Geometry: + case Oyster::Resource::ResourceType_Shader_Pixel: + case Oyster::Resource::ResourceType_Shader_Compute: + resourceData = OResource::ShaderLoader(filename, type); + break; + + case Oyster::Resource::ResourceType_UNKNOWN: + case Oyster::Resource::ResourceType_Byte_Raw: + case Oyster::Resource::ResourceType_Byte_ANSI: + case Oyster::Resource::ResourceType_Byte_UTF8: + case Oyster::Resource::ResourceType_Byte_UNICODE: + case Oyster::Resource::ResourceType_Byte_UTF16LE: + resourceData = OResource::ByteLoader(filename, type); + break; + + default: + //The format is not supported. + printf("(%i) is not a resourceData type or it is currently not supported!", type); + break; + } + + //Resource exists! It's a miracle =D. + resourcePrivate.SaveResource(resourceData); + + return resourceData->GetResourceHandle(); +} +void IResourceHandler::ReleaseResource(const OHRESOURCE& resourceData) +{ + OResource* t = resourcePrivate.FindResource(resourceData); + if(t) + { + if(t->Release()) + { + const wchar_t* temp = t->GetResourceFilename(); + delete resourcePrivate.resources[temp]; + resourcePrivate.resources.erase(temp); + } + } +} +void IResourceHandler::SetResourceId (const OHRESOURCE& resourceData, unsigned int id) +{ + OResource* t = resourcePrivate.FindResource(resourceData); + + if(t) t->SetResourceID(id); +} +ResourceType IResourceHandler::GetResourceType (const OHRESOURCE& resourceData) +{ + OResource* t = resourcePrivate.FindResource(resourceData); + + if(t) return t->GetResourceType(); + + return ResourceType_UNKNOWN; +} +const wchar_t* IResourceHandler::GetResourceFilename (const OHRESOURCE& resourceData) +{ + OResource* t = resourcePrivate.FindResource(resourceData); + + if(t) return t->GetResourceFilename(); + + return 0; +} +unsigned int IResourceHandler::GetResourceId (const OHRESOURCE& resourceData) +{ + OResource* t = resourcePrivate.FindResource(resourceData); + + if(t) return t->GetResourceID(); + + return -1; +} + + + +OResource* ResourcePrivate::FindResource(const OHRESOURCE& h) const +{ + for (auto i = this->resources.begin(); i != this->resources.end() ; i++) + { + if(i->second->GetResourceHandle() == h) + { + return i->second; + } + } + return 0; +} +OResource* ResourcePrivate::FindResource(const wchar_t c[]) const +{ + std::wstring temp = c; + auto t = this->resources.find(c); + if(t == this->resources.end()) return 0; + + return t->second; +} +void ResourcePrivate::SaveResource( OResource* r, bool addNew ) +{ + if(!r) return; + + if(!addNew) + { + r->resourceRef.Incref(); + } + else + { + this->resources[r->GetResourceFilename()] = r; + r->resourceRef.Incref(); + } +} + + + + diff --git a/Code/Misc/Resource/OResourceHandler.h b/Code/Misc/Resource/OResourceHandler.h new file mode 100644 index 00000000..6f853571 --- /dev/null +++ b/Code/Misc/Resource/OResourceHandler.h @@ -0,0 +1,37 @@ +#ifndef MISC_O_RESOURCE_HANLDER_H +#define MISC_O_RESOURCE_HANLDER_H + + +#include "OysterResource.h" + +#include + +///////////////////////////////////////////////////////////////////// +// Created by [Dennis Andersen] [2013] +///////////////////////////////////////////////////////////////////// + + + + +namespace Oyster +{ + namespace Resource + { + class OResourceHandler :public IResourceHandler + { + public: + OResourceHandler (); + virtual~ OResourceHandler (); + void Release () override; + void Clean () override; + OHRESOURCE LoadResource (const wchar_t filename[], ResourceType type, bool force) override; + void ReleaseResource (const OHRESOURCE& resource) override; + void SetResourceId (const OHRESOURCE& resource, unsigned int id) override; + ResourceType GetResourceType (const OHRESOURCE& resource) const override; + const wchar_t* GetResourceFilename (const OHRESOURCE& resource) const override; + unsigned int GetResourceId (const OHRESOURCE& resource) const override; + }; + } +} + +#endif \ No newline at end of file diff --git a/Code/Misc/Resource/OysterResource.h b/Code/Misc/Resource/OysterResource.h new file mode 100644 index 00000000..3dd54acb --- /dev/null +++ b/Code/Misc/Resource/OysterResource.h @@ -0,0 +1,115 @@ +///////////////////////////////////////////////////////////////////// +// Created by [Dennis Andersen] [2013] +///////////////////////////////////////////////////////////////////// + +#ifndef MISC_OYSTER_RESOURCE_H +#define MISC_OYSTER_RESOURCE_H + + +namespace Oyster +{ + namespace Resource + { + /** A Resource handle representing various resources */ + typedef unsigned long OHRESOURCE; + + /** An enum class representing all avalible resources that is supported. */ + enum ResourceType + { + //Texture + ResourceType_Texture_PNG, /**< Handle can be interpeted as ID3D11ShaderResourceView */ + ResourceType_Texture_DDS, /**< Handle can be interpeted as ID3D11ShaderResourceView */ + ResourceType_Texture_JPG, /**< Handle can be interpeted as ID3D11ShaderResourceView */ + + //Mesh + ResourceType_Mesh_AllInOne, /**< Handle can be interpeted as ? */ + ResourceType_Mesh_VertexData, /**< Handle can be interpeted as ? */ + ResourceType_Mesh_AnimationData, /**< Handle can be interpeted as ? */ + + //Audio + ResourceType_Audio_mp3, /**< Handle can be interpeted as ? */ + + //Shaders + ResourceType_Shader_Vertex, /**< Handle can be interpeted as ? */ + ResourceType_Shader_VertexBLOB, /**< Handle can be interpeted as ID3Blob */ + ResourceType_Shader_Hull, /**< Handle can be interpeted as ? */ + ResourceType_Shader_Domain, /**< Handle can be interpeted as ? */ + ResourceType_Shader_Geometry, /**< Handle can be interpeted as ? */ + ResourceType_Shader_Pixel, /**< Handle can be interpeted as ? */ + ResourceType_Shader_Compute, /**< Handle can be interpeted as ? */ + + //Byte + ResourceType_Byte_Raw, /**< Handle can be interpeted as char[] or char* */ + ResourceType_Byte_ANSI, /**< Handle can be interpeted as char[] or char* */ + ResourceType_Byte_UTF8, /**< Handle can be interpeted as char[] or char* */ + ResourceType_Byte_UNICODE, /**< Handle can be interpeted as char[] or char* */ + ResourceType_Byte_UTF16LE, /**< Handle can be interpeted as char[] or char* */ + + ResourceType_COUNT, /**< Handle can be interpeted as ? */ + ResourceType_UNKNOWN = -1 /**< Handle can be interpeted as char[] or char* */ + }; + + /** A resource handler interface to interact with when loading resources. + * The resource handler uses the filename to make resources unuiqe. + */ + class IResourceHandler + { + public: + + /** + * Release the resource handle, wich in turn releases every resource loaded with this instance. + * @return Nothing. + */ + static void Release(); + + /** + * Load a resource given a type. + * @param filename The path to the resource. + * @param type The resource type to load. + * @param force If set to true, the resource will be reloaded if it already exists. If it does not, nothing happens. + * @return If function suceeds, a handle to the resource will be returned. If failed 0 is returned. + */ + static OHRESOURCE LoadResource(const wchar_t filename[], ResourceType type, bool force = false); + + /** + * Releases all resources loaded by the resource handler. + * @return Nothing + */ + static void Clean(); + + /** + * Release a reference to the resource handle + * @param resource The handle to release. + * @return Nothing + */ + static void ReleaseResource(const OHRESOURCE& resource); + + /** Set a user defined ID + * @param resource A handle to accociate the id with. + * @param id A user defined identifier that the resource handler does not touch. + */ + static void SetResourceId(const OHRESOURCE& resource, unsigned int id); + + /** Get a resource type given a OHRESOURCE handle + * @param resource The handle to check + * @return Returns the resource type of the handle + */ + static ResourceType GetResourceType(const OHRESOURCE& resource); + + /** Get a resource filename given a OHRESOURCE handle + * @param resource The handle to check + * @return Returns the accociated filename + */ + static const wchar_t* GetResourceFilename(const OHRESOURCE& resource); + + /** Get a user defined ID accociated with a handle + * @param resource The handle to check + * @return Returns the accociated ID + */ + static unsigned int GetResourceId(const OHRESOURCE& resource); + + }; + } +} + +#endif diff --git a/Code/Misc/Utilities.cpp b/Code/Misc/Utilities.cpp index 502541b2..cdf3d136 100644 --- a/Code/Misc/Utilities.cpp +++ b/Code/Misc/Utilities.cpp @@ -281,6 +281,53 @@ namespace Utility return output; } + ::std::wstring & wToLowerCase( ::std::wstring &output, const ::std::wstring &str ) + { + int length = (int)str.length(); + output.resize( length ); + for( int i = 0; i < length; ++i ) + output[i] = ::std::tolower( str[i], ::std::locale() ); + return output; + } + + ::std::wstring & wToLowerCase( ::std::wstring &str ) + { + int length = (int)str.length(); + for( int i = 0; i < length; ++i ) + str[i] = ::std::tolower( str[i], ::std::locale() ); + return str; + } + + //To wstring + + ::std::wstring & StringToWString( const ::std::string &str, ::std::wstring &wstr ) + { + const char *orig = str.c_str(); + + // Convert to a wchar_t* + size_t origsize = strlen(orig) + 1; + const size_t newsize = 255; + size_t convertedChars = 0; + wchar_t wcstring[newsize]; + mbstowcs_s(&convertedChars, wcstring, origsize, orig, _TRUNCATE); + wstr = wcstring; + //wcscat_s(wcstring, L" (wchar_t *)"); + return wstr; + } + + ::std::string & WStringToString( const ::std::wstring &wstr, ::std::string &str ) + { + const wchar_t* orig = wstr.c_str(); + // Convert to a char* + size_t origsize = wcslen(orig) + 1; + const size_t newsize = 255; + size_t convertedChars = 0; + char nstring[newsize]; + wcstombs_s(&convertedChars, nstring, origsize, orig, _TRUNCATE); + str = nstring; + //strcat_s(nstring, " (char *)"); + return str; + } } // STREAM //////////////////////////////////////////////////////////// diff --git a/Code/Misc/Utilities.h b/Code/Misc/Utilities.h index 950c3933..2ff40926 100644 --- a/Code/Misc/Utilities.h +++ b/Code/Misc/Utilities.h @@ -105,6 +105,19 @@ namespace Utility private: mutable Type *ownedArray; }; + + struct RefCount + { + private: + int count; + + public: + RefCount() :count(0) { } + void Incref() { this->count++; } + void Incref(int c) { this->count += c; } + int Decref() { return --this->count;} + void Reset() { this->count = 0; } + }; } namespace String @@ -128,6 +141,13 @@ namespace Utility ::std::vector<::std::wstring> & Split( ::std::vector<::std::wstring> &output, const ::std::wstring &str, char delim, ::std::wstring::size_type offset = 0 ); ::std::vector<::std::wstring> & Split( ::std::vector<::std::wstring> &output, const ::std::wstring &str, const ::std::wstring &delim, ::std::wstring::size_type offset = 0 ); ::std::vector<::std::wstring> & Split( ::std::vector<::std::wstring> &output, const ::std::wstring &str, const ::std::vector<::std::wstring> &delim, ::std::wstring::size_type offset = 0 ); + ::std::wstring & wToLowerCase( ::std::wstring &output, const ::std::wstring &str ); + ::std::wstring & wToLowerCase( ::std::wstring &str ); + + //To wstring + + ::std::wstring & StringToWstring( const ::std::string &str, ::std::wstring &wstr ); + ::std::string & WStringToString( const ::std::wstring &wstr, ::std::string &str ); } namespace Stream diff --git a/Code/Tester/Debug/MainTest.obj b/Code/Tester/Debug/MainTest.obj deleted file mode 100644 index 3fa96e29..00000000 Binary files a/Code/Tester/Debug/MainTest.obj and /dev/null differ diff --git a/Code/Tester/Debug/Tester.lastbuildstate b/Code/Tester/Debug/Tester.lastbuildstate deleted file mode 100644 index 40d074b4..00000000 --- a/Code/Tester/Debug/Tester.lastbuildstate +++ /dev/null @@ -1,2 +0,0 @@ -#v4.0:v110:false -Debug|Win32|C:\DanBias\Danbias\| diff --git a/Code/Tester/Debug/Tester.log b/Code/Tester/Debug/Tester.log deleted file mode 100644 index 2c2e96b0..00000000 --- a/Code/Tester/Debug/Tester.log +++ /dev/null @@ -1,13 +0,0 @@ -Build started 11/15/2013 11:04:26 AM. - 1>Project "C:\DanBias\Danbias\Tester\Tester.vcxproj" on node 3 (Build target(s)). - 1>Link: - C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\DanBias\Danbias\Debug\Tester.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\DanBias\Danbias\Debug\Tester.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\DanBias\Danbias\Debug\Tester.lib" /MACHINE:X86 Debug\MainTest.obj - C:\DanBias\External\Lib\Misc\Misc_x86D.lib - C:\DanBias\External\Lib\OysterMath\OysterMath_x86D.lib - C:\DanBias\External\Lib\OysterGraphics\OysterGraphics_x86D.lib - Tester.vcxproj -> C:\DanBias\Danbias\Debug\Tester.exe - 1>Done Building Project "C:\DanBias\Danbias\Tester\Tester.vcxproj" (Build target(s)). - -Build succeeded. - -Time Elapsed 00:00:00.98 diff --git a/Code/Tester/Debug/Tester.vcxprojResolveAssemblyReference.cache b/Code/Tester/Debug/Tester.vcxprojResolveAssemblyReference.cache deleted file mode 100644 index 7a891077..00000000 Binary files a/Code/Tester/Debug/Tester.vcxprojResolveAssemblyReference.cache and /dev/null differ diff --git a/Code/Tester/Debug/vc110.idb b/Code/Tester/Debug/vc110.idb deleted file mode 100644 index 7790813b..00000000 Binary files a/Code/Tester/Debug/vc110.idb and /dev/null differ diff --git a/Code/Tester/Debug/vc110.pdb b/Code/Tester/Debug/vc110.pdb deleted file mode 100644 index 7a8bf47b..00000000 Binary files a/Code/Tester/Debug/vc110.pdb and /dev/null differ diff --git a/Code/Tester/Tester.vcxproj b/Code/Tester/Tester.vcxproj index ac461ea2..a810a51a 100644 --- a/Code/Tester/Tester.vcxproj +++ b/Code/Tester/Tester.vcxproj @@ -69,18 +69,26 @@ true $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(SolutionDir)..\Bin\Executable\$(ProjectName)\ + $(ProjectName)_$(PlatformShortName)D true $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(SolutionDir)..\Bin\Executable\$(ProjectName)\ + $(ProjectName)_$(PlatformShortName)D false $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(SolutionDir)..\Bin\Executable\$(ProjectName)\ + $(ProjectName)_$(PlatformShortName) false $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(SolutionDir)..\Bin\Executable\$(ProjectName)\ + $(ProjectName)_$(PlatformShortName)