2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 10:37:41 -04:00

Get rid of pnUtils PCH stuff.

--HG--
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxStr.cpp => Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxStr.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxSync.cpp => Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxSync.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp => Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/W32Int.h => Sources/Plasma/NucleusLib/pnUtils/Win32/W32Int.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Addr.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Dll.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Misc.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Path.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Str.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Time.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h => Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAllIncludes.h => Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtArray.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h => Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h => Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h => Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h => Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h => Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h => Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h => Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h => Sources/Plasma/NucleusLib/pnUtils/pnUtList.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h => Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h => Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtPath.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h => Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h => Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h => Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtRand.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h => Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h => Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h => Sources/Plasma/NucleusLib/pnUtils/pnUtSkipList.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h => Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h => Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h => Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h => Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h => Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtTls.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h => Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h => Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp
rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h => Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h
This commit is contained in:
Darryl Pogue
2012-01-28 22:24:28 -08:00
parent 805dd6c2cd
commit a964066656
60 changed files with 123 additions and 611 deletions

View File

@ -2,88 +2,81 @@ include_directories("../../CoreLib")
include_directories("../../NucleusLib")
set(pnUtils_HEADERS
Intern.h
Pch.h
pnUtils.h
)
set(pnUtils_PRIVATE
Private/pnUtAddr.h
Private/pnUtAddr.cpp
Private/pnUtAllIncludes.h
Private/pnUtArray.h
Private/pnUtArray.cpp
Private/pnUtBase64.h
Private/pnUtBase64.cpp
Private/pnUtBigNum.h
Private/pnUtBigNum.cpp
Private/pnUtCmd.h
Private/pnUtCmd.cpp
Private/pnUtCoreLib.h
Private/pnUtCrypt.h
Private/pnUtCrypt.cpp
Private/pnUtHash.h
Private/pnUtHash.cpp
Private/pnUtList.h
Private/pnUtList.cpp
Private/pnUtMath.h
Private/pnUtMath.cpp
Private/pnUtMisc.h
Private/pnUtMisc.cpp
Private/pnUtPath.h
Private/pnUtPath.cpp
Private/pnUtPragma.h
Private/pnUtPriQ.h
Private/pnUtRand.h
Private/pnUtRand.cpp
Private/pnUtRef.h
Private/pnUtSkipList.h
Private/pnUtSort.h
Private/pnUtSpareList.h
Private/pnUtSpareList.cpp
Private/pnUtStr.h
Private/pnUtStr.cpp
Private/pnUtSubst.h
Private/pnUtSubst.cpp
Private/pnUtSync.h
Private/pnUtTime.h
Private/pnUtTime.cpp
Private/pnUtTls.h
Private/pnUtTls.cpp
Private/pnUtUuid.h
Private/pnUtUuid.cpp
pnUtCoreLib.h
pnUtAddr.h
pnUtAllIncludes.h
pnUtArray.h
pnUtBase64.h
pnUtBigNum.h
pnUtCmd.h
pnUtCrypt.h
pnUtHash.h
pnUtList.h
pnUtMath.h
pnUtMisc.h
pnUtPath.h
pnUtPragma.h
pnUtPriQ.h
pnUtRand.h
pnUtRef.h
pnUtSkipList.h
pnUtSort.h
pnUtSpareList.h
pnUtStr.h
pnUtSync.h
pnUtTime.h
pnUtTls.h
pnUtUuid.h
)
set(pnUtils_SOURCES
pnUtils.cpp
pnUtAddr.cpp
pnUtArray.cpp
pnUtBase64.cpp
pnUtBigNum.cpp
pnUtCmd.cpp
pnUtHash.cpp
pnUtList.cpp
pnUtMath.cpp
pnUtMisc.cpp
pnUtPath.cpp
pnUtRand.cpp
pnUtSpareList.cpp
pnUtStr.cpp
pnUtTime.cpp
)
if(WIN32)
set(pnUtils_WIN32
Private/Win32/pnUtW32Addr.cpp
Private/Win32/pnUtW32Misc.cpp
Private/Win32/pnUtW32Path.cpp
Private/Win32/pnUtW32Str.cpp
Private/Win32/pnUtW32Sync.cpp
Private/Win32/pnUtW32Time.cpp
Private/Win32/pnUtW32Uuid.cpp
Win32/pnUtW32Addr.cpp
Win32/pnUtW32Misc.cpp
Win32/pnUtW32Path.cpp
Win32/pnUtW32Str.cpp
Win32/pnUtW32Sync.cpp
Win32/pnUtW32Time.cpp
Win32/pnUtW32Uuid.cpp
pnUtCrypt.cpp
pnUtTls.cpp
pnUtUuid.cpp
)
else()
set(pnUtils_UNIX
Private/Unix/pnUtUxStr.cpp
Private/Unix/pnUtUxSync.cpp
Private/Unix/pnUtUxUuid.cpp
Unix/pnUtUxStr.cpp
#Unix/pnUtUxSync.cpp
#Unix/pnUtUxUuid.cpp
)
endif()
add_library(pnUtils STATIC ${pnUtils_HEADERS} ${pnUtils_PRIVATE} ${pnUtils_SOURCES}
add_library(pnUtils STATIC ${pnUtils_HEADERS} ${pnUtils_SOURCES}
${pnUtils_UNIX} ${pnUtils_WIN32})
source_group("Header Files" FILES ${pnUtils_HEADERS})
source_group("Source Files" FILES ${pnUtils_SOURCES})
source_group("Private" FILES ${pnUtils_PRIVATE})
if(WIN32)
source_group("Private\\Win32" FILES ${pnUtils_WIN32})
source_group("Win32" FILES ${pnUtils_WIN32})
else()
source_group("Private\\Unix" FILES ${pnUtils_UNIX})
source_group("Unix" FILES ${pnUtils_UNIX})
endif()

View File

@ -1,70 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
/*****************************************************************************
*
* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Intern.h
*
***/
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_INTERN_H
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Intern.h included more than once"
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_INTERN_H
/*****************************************************************************
*
* Crypt
*
***/
namespace Crypt {
//============================================================================
class KeyBase {
public:
virtual void Codec (bool encrypt, ARRAY(uint8_t) * dest, unsigned sourceBytes, const void * sourceData) = 0;
virtual unsigned GetBlockSize () const = 0;
};
} // namespace Crypt

View File

@ -45,14 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Pch.h included more than once"
#endif
#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H
#include "Private/pnUtAllIncludes.h"
#include "Intern.h"
#include "pnUtCoreLib.h" // must be first in list
#include "pnUtPragma.h"
#include "pnProduct/pnProduct.h"
#include <malloc.h>
@ -66,4 +63,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#pragma warning(pop)
#endif
#include <malloc.h> // _alloca
#endif

View File

@ -1,302 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
/*****************************************************************************
*
* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp
*
***/
#include "../Pch.h"
#pragma hdrstop
#define SUBST_BLOCK SubstParsedData<chartype>::SubstBlock<chartype>
/*****************************************************************************
*
* Internal functions
*
***/
//============================================================================
template <typename chartype>
bool IVarSubstitute (
ARRAY(chartype) * dst,
const chartype src[],
unsigned varCount,
const chartype * varNames[], // [varCount]
const chartype * varValues[] // [varCount]
) {
ASSERT(dst);
ASSERT(src);
ASSERT(varNames);
ASSERT(varValues);
dst->Reserve(StrLen(src) * 5/4);
bool result = true;
while (*src) {
// Copy non-substituted strings and escape %% symbols
if ((*src != L'%') || (*++src == L'%')) {
dst->Push(*src++);
continue;
}
// Find variable definition
const chartype * varStart = src;
const chartype * varEnd = StrChr(varStart, L'%');
if (!varEnd) {
// Skip % character and continue
result = false;
continue;
}
// Validate variable name length
chartype varBuffer[256];
if (varEnd - varStart >= arrsize(varBuffer)) {
result = false;
src = varEnd + 1;
continue;
}
// Copy variable name excluding trailing '%'
StrCopy(varBuffer, varStart, varEnd - varStart + 1);
src = varEnd + 1;
// Find the variable value and perform substitution
bool found = false;
for (unsigned i = 0; i < varCount; ++i) {
if (StrCmp(varBuffer, varNames[i]))
continue;
dst->Add(varValues[i], StrLen(varValues[i]));
found = true;
break;
}
// Check that variable definition exists
result = result && found;
}
// Terminate string
dst->Push(0);
return result;
}
//============================================================================
template <typename chartype>
bool IParseForSubst (
SubstParsedData<chartype> * dest,
const chartype src[]
) {
const chartype * current = src;
bool result = true;
while (*current) {
// Copy non-substituted strings and escape %% symbols
if ((*current != L'%') || (*++current == L'%')) {
current++;
continue;
}
// Find variable definition
const chartype * varStart = current;
const chartype * varEnd = StrChr(varStart, L'%');
if (!varEnd) {
// Skip % character and continue
result = false;
continue;
}
// We've found a variable, copy the current data to a new object
if (current != src) {
int strLen = (current - src) - 1;
SUBST_BLOCK * block = new SUBST_BLOCK;
block->isVar = false;
block->strLen = strLen;
block->data = (chartype*)calloc((strLen + 1), sizeof(chartype));
memcpy(block->data, src, strLen * sizeof(chartype));
dest->blocks.Add(block);
}
// Validate variable name length
chartype varBuffer[256];
if (varEnd - varStart >= arrsize(varBuffer)) {
result = false;
src = current = varEnd + 1;
continue;
}
// Copy variable name excluding trailing '%'
int strLen = (varEnd - varStart);
SUBST_BLOCK * block = new SUBST_BLOCK;
block->isVar = true;
block->strLen = strLen;
block->data = (chartype*)calloc((strLen + 1), sizeof(chartype));
memcpy(block->data, varStart, strLen * sizeof(chartype));
dest->blocks.Add(block);
src = current = varEnd + 1;
}
// Check and see if there's any data remaining
if (current != src) {
int strLen = (current - src);
SUBST_BLOCK * block = new SUBST_BLOCK;
block->isVar = false;
block->strLen = strLen;
block->data = (chartype*)calloc((strLen + 1), sizeof(chartype));
memcpy(block->data, src, strLen * sizeof(chartype));
dest->blocks.Add(block);
}
return result;
}
//============================================================================
template <typename chartype>
bool IVarSubstPreParsed (
ARRAY(chartype) * dst,
const SubstParsedData<chartype> * src,
unsigned varCount,
const chartype * varNames[], // [varCount]
const chartype * varValues[] // [varCount]
) {
unsigned approxTotalSize = 0;
for (unsigned i = 0; i < src->blocks.Count(); ++i) {
approxTotalSize += src->blocks[i]->strLen;
}
dst->Reserve(approxTotalSize * 5/4);
bool foundAll = true;
for (unsigned blockIndex = 0; blockIndex < src->blocks.Count(); ++blockIndex) {
SUBST_BLOCK * block = src->blocks[blockIndex];
if (block->isVar) {
bool found = false;
for (unsigned varIndex = 0; varIndex < varCount; ++varIndex) {
if (StrCmp(block->data, varNames[varIndex])) {
continue;
}
dst->Add(varValues[varIndex], StrLen(varValues[varIndex]));
found = true;
break;
}
foundAll &= found;
}
else {
dst->Add(block->data, block->strLen);
}
}
dst->Push(0);
return foundAll;
}
/*****************************************************************************
*
* Exports
*
***/
//============================================================================
bool ParseForSubst (
SubstParsedData<wchar_t> * dest,
const wchar_t src[]
) {
return IParseForSubst(dest, src);
}
//============================================================================
bool ParseForSubst (
SubstParsedData<char> * dest,
const char src[]
) {
return IParseForSubst(dest, src);
}
//============================================================================
bool VarSubstitute (
ARRAY(wchar_t) * dst,
const wchar_t src[],
unsigned varCount,
const wchar_t * varNames[], // [varCount]
const wchar_t * varValues[] // [varCount]
) {
return IVarSubstitute(dst, src, varCount, varNames, varValues);
}
//============================================================================
bool VarSubstitute (
ARRAY(char) * dst,
const char src[],
unsigned varCount,
const char * varNames[], // [varCount]
const char * varValues[] // [varCount]
) {
return IVarSubstitute(dst, src, varCount, varNames, varValues);
}
//============================================================================
bool VarSubstitute (
ARRAY(wchar_t) * dst,
const SubstParsedData<wchar_t> * src,
unsigned varCount,
const wchar_t * varNames[], // [varCount]
const wchar_t * varValues[] // [varCount]
) {
return IVarSubstPreParsed(dst, src, varCount, varNames, varValues);
}
//============================================================================
bool VarSubstitute (
ARRAY(char) * dst,
const SubstParsedData<char> * src,
unsigned varCount,
const char * varNames[], // [varCount]
const char * varValues[] // [varCount]
) {
return IVarSubstPreParsed(dst, src, varCount, varNames, varValues);
}

View File

@ -1,119 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
/*****************************************************************************
*
* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h
*
***/
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSUBST_H
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h included more than once"
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSUBST_H
template<typename chartype>
struct SubstParsedData {
template<typename char_type>
struct SubstBlock {
bool isVar;
char_type * data;
unsigned strLen;
SubstBlock()
: isVar(false)
, data(nil)
{
}
~SubstBlock() {
free(data);
}
};
ARRAY(SubstBlock<chartype>*) blocks;
~SubstParsedData() {
for (unsigned i = 0; i < blocks.Count(); ++i) {
SubstBlock<chartype> * block = blocks[i];
delete block;
}
}
};
bool ParseForSubst (
SubstParsedData<wchar_t> * dest,
const wchar_t src[]
);
bool ParseForSubst (
SubstParsedData<char> * dest,
const char src[]
);
// Return value is for validation purposes only; it may be ignored
bool VarSubstitute (
ARRAY(wchar_t) * dst,
const wchar_t src[],
unsigned varCount,
const wchar_t * varNames[], // [varCount]
const wchar_t * varValues[] // [varCount]
);
bool VarSubstitute (
ARRAY(char) * dst,
const char src[],
unsigned varCount,
const char * varNames[], // [varCount]
const char * varValues[] // [varCount]
);
bool VarSubstitute (
ARRAY(wchar_t) * dst,
const SubstParsedData<wchar_t> * src,
unsigned varCount,
const wchar_t * varNames[], // [varCount]
const wchar_t * varValues[] // [varCount]
);
bool VarSubstitute (
ARRAY(char) * dst,
const SubstParsedData<char> * src,
unsigned varCount,
const char * varNames[], // [varCount]
const char * varValues[] // [varCount]
);

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../../Pch.h"
#pragma hdrstop
#include "../pnUtStr.h"
#ifdef HS_BUILD_FOR_UNIX

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../../Pch.h"
#pragma hdrstop
#include "../pnUtSync.h"
#ifdef HS_BUILD_FOR_UNIX

View File

@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../../Pch.h"
#pragma hdrstop
#include "../pnUtUUID.h"
/*****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtAddr.h"
/*****************************************************************************

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTADDR_H
#include "Pch.h"
/*****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtArray.h"
/****************************************************************************

View File

@ -45,11 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h included more than once"
#endif
#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H
#include "Pch.h"
#include "pnUtSort.h"
/****************************************************************************
*
@ -1081,3 +1081,4 @@ void TSortArray<T,C,K,OFFSET>::Sort () {
SortKey(elem1) > SortKey(elem2)
);
}
#endif

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtBase64.h"
/*****************************************************************************

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBASE64_H
#include "Pch.h"
/*****************************************************************************

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtBigNum.h"
#include <openssl/rand.h>
#include <algorithm>

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBIGNUM_H
#include "Pch.h"
/*****************************************************************************
*

View File

@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtCmd.h"
#include "pnUtMisc.h"
/*****************************************************************************
@ -61,7 +61,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define TOGGLES L"+-"
#define ALL WHITESPACE FLAGS SEPARATORS TOGGLES
#if HS_BUILD_FOR_WIN32
static const unsigned kMaxTokenLength = MAX_PATH;
#else
static const unsigned kMaxTokenLength = 1024;
#endif
struct CmdArgData {
CmdArgDef def;

View File

@ -50,6 +50,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCMD_H
#include "Pch.h"
#include "pnUtArray.h"
#include "pnUtStr.h"
/*****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtCrypt.h"
#include <openssl/md5.h>
#include <openssl/sha.h>

View File

@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H
#include "Pch.h"
#include "pnUtArray.h"
/*****************************************************************************
*

View File

@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtHash.h"
/****************************************************************************
*
@ -91,4 +89,4 @@ const uint32_t CHashValue::s_hashTable[] = {
0x4f23137b, 0x9dfd6434, 0xd1e25d94, 0xbad4c88a, 0x0746edf9, 0x8103a9aa, 0xc8c73617, 0xe0f2759a,
0x00161c79, 0xd4545360, 0x1763cc5b, 0x296361fa, 0xbc35858d, 0xdaed5e93, 0x0b9d0aed, 0x01c45a64,
};

View File

@ -50,6 +50,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H
#include "Pch.h"
#include "pnUtList.h"
#include "pnUtArray.h"
#include "pnUtMath.h"
/****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtList.h"
/****************************************************************************

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H
#include "Pch.h"
/****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtMath.h"
/*****************************************************************************

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMATH_H
#include "Pch.h"
/*****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtMisc.h"
/*****************************************************************************

View File

@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMISC_H
#include "Pch.h"
#include "pnUtArray.h"
/*****************************************************************************
*

View File

@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtPath.h"
#include "pnUtStr.h"
/****************************************************************************

View File

@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPATH_H
#include "Pch.h"
#include "pnUtArray.h"
/*****************************************************************************
*

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H
#include "Pch.h"
/****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtRand.h"
/*****************************************************************************

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTRAND_H
#include "Pch.h"
/*****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtSpareList.h"
/****************************************************************************

View File

@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSPARELIST_H
#include "Pch.h"
#include <typeinfo>
#ifdef HS_DEBUGGING

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtStr.h"
/*****************************************************************************
@ -522,7 +521,7 @@ const wchar_t * StrChrR (const wchar_t str[], wchar_t ch) {
unsigned StrPrintf (char * dest, unsigned count, const char format[], ...) {
va_list argList;
va_start(argList, format);
int result = _vsnprintf((char *)dest, count, (const char *)format, argList);
int result = hsVsnprintf((char *)dest, count, (const char *)format, argList);
va_end(argList);
return IStrPrintfValidate(dest, count, result);
}
@ -531,20 +530,20 @@ unsigned StrPrintf (char * dest, unsigned count, const char format[], ...) {
unsigned StrPrintf (wchar_t * dest, unsigned count, const wchar_t format[], ...) {
va_list argList;
va_start(argList, format);
int result = _vsnwprintf(dest, count, format, argList);
int result = hsVsnwprintf(dest, count, format, argList);
va_end(argList);
return IStrPrintfValidate(dest, count, result);
}
//===========================================================================
unsigned StrPrintfV (char * dest, unsigned count, const char format[], va_list args) {
int result = _vsnprintf(dest, count, format, args);
int result = hsVsnprintf(dest, count, format, args);
return IStrPrintfValidate(dest, count, result);
}
//===========================================================================
unsigned StrPrintfV (wchar_t * dest, unsigned count, const wchar_t format[], va_list args) {
int result = _vsnwprintf(dest, count, format, args);
int result = hsVsnwprintf(dest, count, format, args);
return IStrPrintfValidate(dest, count, result);
}

View File

@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H
#include "Pch.h"
#include "pnUtArray.h"
/*****************************************************************************
*

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSYNC_H
#include "Pch.h"
/****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtTime.h"
/*****************************************************************************

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H
#include "Pch.h"
/*****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtTls.h"
/*****************************************************************************

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTLS_H
#include "Pch.h"
/*****************************************************************************
*

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*
***/
#include "../Pch.h"
#pragma hdrstop
#include "pnUtUuid.h"
const Uuid kNilGuid;

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H
#include "Pch.h"
/*****************************************************************************
*