Initial commit: ROW Client source code
Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
141
Engine/Zalla3D Scene Class/SimpleString.h
Normal file
141
Engine/Zalla3D Scene Class/SimpleString.h
Normal file
@@ -0,0 +1,141 @@
|
||||
// SimpleString.h: interface for the SimpleString class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_SIMPLESTRING_H__F55EEDA2_FCE0_11D4_AD2B_0000E8EB4C69__INCLUDED_)
|
||||
#define AFX_SIMPLESTRING_H__F55EEDA2_FCE0_11D4_AD2B_0000E8EB4C69__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
|
||||
#include "misc.h"
|
||||
#include <string>
|
||||
|
||||
|
||||
struct SimpleString
|
||||
{
|
||||
public:
|
||||
SimpleString()
|
||||
{
|
||||
m_lAllocLength = 1;
|
||||
m_szString = new char[1];
|
||||
m_szString[0] = '\0';
|
||||
}
|
||||
|
||||
SimpleString( const char* szString )
|
||||
{
|
||||
_ASSERT( szString );
|
||||
|
||||
m_lAllocLength = static_cast<long>(strlen( szString )+1);
|
||||
|
||||
m_szString = new char[m_lAllocLength];
|
||||
strcpy( m_szString, szString );
|
||||
}
|
||||
|
||||
SimpleString( const char* szString, int n )
|
||||
{
|
||||
_ASSERT( szString );
|
||||
|
||||
m_lAllocLength = n+1;
|
||||
|
||||
m_szString = new char[m_lAllocLength];
|
||||
strncpy( m_szString, szString, n );
|
||||
m_szString[n] = '\0';
|
||||
}
|
||||
|
||||
SimpleString( const char* szString1, const char* szString2 )
|
||||
{
|
||||
_ASSERT( szString1 );
|
||||
_ASSERT( szString2 );
|
||||
|
||||
m_lAllocLength = static_cast<long>(strlen(szString1) + strlen(szString2) + 1);
|
||||
|
||||
m_szString = new char[m_lAllocLength];
|
||||
strcpy( m_szString, szString1 );
|
||||
strcat( m_szString, szString2 );
|
||||
}
|
||||
|
||||
~SimpleString()
|
||||
{
|
||||
SAFE_DELETEA( m_szString );
|
||||
}
|
||||
|
||||
long Length()
|
||||
{
|
||||
return static_cast<long>(strlen(m_szString));
|
||||
}
|
||||
|
||||
operator const char*() const
|
||||
{
|
||||
return m_szString;
|
||||
}
|
||||
|
||||
void operator ()(const char* szString)
|
||||
{
|
||||
_ASSERT( szString );
|
||||
|
||||
if( (long)strlen(szString) < m_lAllocLength )
|
||||
{
|
||||
strcpy( m_szString, szString );
|
||||
}
|
||||
else
|
||||
{
|
||||
SAFE_DELETEA( m_szString );
|
||||
m_lAllocLength = static_cast<long>(strlen(szString)+1);
|
||||
|
||||
m_szString = new char[m_lAllocLength];
|
||||
strcpy( m_szString, szString );
|
||||
}
|
||||
}
|
||||
|
||||
void operator ()( const char* szString1, const char* szString2 )
|
||||
{
|
||||
_ASSERT( szString1 );
|
||||
_ASSERT( szString2 );
|
||||
|
||||
if( (long)(strlen(szString1)+strlen(szString2)) < m_lAllocLength )
|
||||
{
|
||||
strcpy( m_szString, szString1 );
|
||||
strcat( m_szString, szString2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
SAFE_DELETEA( m_szString );
|
||||
m_lAllocLength = static_cast<long>(strlen(szString1) + strlen(szString2) + 1);
|
||||
|
||||
m_szString = new char[m_lAllocLength];
|
||||
strcpy( m_szString, szString1 );
|
||||
strcat( m_szString, szString2 );
|
||||
}
|
||||
}
|
||||
|
||||
SimpleString& operator =(const char* szString)
|
||||
{
|
||||
_ASSERT( szString );
|
||||
|
||||
if( (long)strlen(szString) < m_lAllocLength )
|
||||
{
|
||||
strcpy( m_szString, szString );
|
||||
}
|
||||
else
|
||||
{
|
||||
SAFE_DELETEA( m_szString );
|
||||
m_lAllocLength = static_cast<long>(strlen(szString)+1);
|
||||
|
||||
m_szString = new char[m_lAllocLength];
|
||||
strcpy( m_szString, szString );
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
char* m_szString;
|
||||
long m_lAllocLength;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_SIMPLESTRING_H__F55EEDA2_FCE0_11D4_AD2B_0000E8EB4C69__INCLUDED_)
|
||||
Reference in New Issue
Block a user