mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +00:00
Add OpenString to FScanner class
This commit is contained in:
parent
3061bcf604
commit
f7bd3acec4
3 changed files with 17 additions and 3 deletions
|
@ -1061,7 +1061,7 @@ public:
|
||||||
if (tagstring.IsNotEmpty())
|
if (tagstring.IsNotEmpty())
|
||||||
{
|
{
|
||||||
FScanner sc;
|
FScanner sc;
|
||||||
sc.OpenMem("tagstring", tagstring.GetChars(), tagstring.Len());
|
sc.OpenString("tagstring", tagstring);
|
||||||
// scan the string as long as valid numbers can be found
|
// scan the string as long as valid numbers can be found
|
||||||
while (sc.CheckNumber())
|
while (sc.CheckNumber())
|
||||||
{
|
{
|
||||||
|
@ -1536,7 +1536,7 @@ public:
|
||||||
if (tagstring.IsNotEmpty())
|
if (tagstring.IsNotEmpty())
|
||||||
{
|
{
|
||||||
FScanner sc;
|
FScanner sc;
|
||||||
sc.OpenMem("tagstring", tagstring.GetChars(), tagstring.Len());
|
sc.OpenString("tagstring", tagstring);
|
||||||
// scan the string as long as valid numbers can be found
|
// scan the string as long as valid numbers can be found
|
||||||
while (sc.CheckNumber())
|
while (sc.CheckNumber())
|
||||||
{
|
{
|
||||||
|
|
|
@ -195,9 +195,22 @@ void FScanner::OpenFile (const char *name)
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void FScanner::OpenMem (const char *name, const char *buffer, int size)
|
void FScanner::OpenMem (const char *name, const char *buffer, int size)
|
||||||
|
{
|
||||||
|
OpenString(name, FString(buffer, size));
|
||||||
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// FScanner :: OpenString
|
||||||
|
//
|
||||||
|
// Like OpenMem, but takes a string directly.
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
void FScanner::OpenString (const char *name, FString buffer)
|
||||||
{
|
{
|
||||||
Close ();
|
Close ();
|
||||||
ScriptBuffer = FString(buffer, size);
|
ScriptBuffer = buffer;
|
||||||
ScriptName = name;
|
ScriptName = name;
|
||||||
LumpNum = -1;
|
LumpNum = -1;
|
||||||
PrepareScript ();
|
PrepareScript ();
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
void Open(const char *lumpname);
|
void Open(const char *lumpname);
|
||||||
void OpenFile(const char *filename);
|
void OpenFile(const char *filename);
|
||||||
void OpenMem(const char *name, const char *buffer, int size);
|
void OpenMem(const char *name, const char *buffer, int size);
|
||||||
|
void OpenString(const char *name, FString buffer);
|
||||||
void OpenLumpNum(int lump);
|
void OpenLumpNum(int lump);
|
||||||
void Close();
|
void Close();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue