Use a const str& reference

This commit is contained in:
smallmodel 2023-12-29 20:19:28 +01:00
parent eb7d01b3e7
commit 43218f1685
No known key found for this signature in database
GPG key ID: A96F163ED4891440
6 changed files with 16 additions and 16 deletions

View file

@ -203,7 +203,7 @@ void FilePickerClass::SetupFiles(void)
window->setTitle(currentDirectory);
}
void FilePickerClass::FileSelected(str& currentDirectory, str& partialName, str& fullname) {}
void FilePickerClass::FileSelected(const str& currentDirectory, const str& partialName, const str& fullname) {}
void FilePickerClass::FileSelected(Event *ev)
{
@ -216,7 +216,7 @@ void FilePickerClass::FileSelected(Event *ev)
uii.Snd_PlaySound("sound/menu/scroll.wav");
}
void FilePickerClass::FileChosen(str& currentDirectory, str& partialName, str& fullname) {}
void FilePickerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) {}
void FilePickerClass::FileChosen(Event *ev)
{

View file

@ -47,9 +47,9 @@ private:
protected:
void CloseWindow(void);
void FileSelected(Event *ev);
virtual void FileSelected(str& currentDirectory, str& partialName, str& fullname);
virtual void FileSelected(const str& currentDirectory, const str& partialName, const str& fullname);
void FileChosen(Event *ev);
virtual void FileChosen(str& currentDirectory, str& partialName, str& fullname);
virtual void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname);
void OnDeactivated(Event *ev);
public:

View file

@ -26,7 +26,7 @@ CLASS_DECLARATION(FilePickerClass, MapRunnerClass, NULL) {
{NULL, NULL}
};
void MapRunnerClass::FileChosen(str& currentDirectory, str& partialName, str& fullname)
void MapRunnerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
{
str newName;
@ -54,7 +54,7 @@ UIPickFileClass::~UIPickFileClass()
}
}
void UIPickFileClass::FileChosen(str& currentDirectory, str& partialName, str& fullname)
void UIPickFileClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
{
if (!retobj || !retevent) {
CloseWindow();
@ -101,7 +101,7 @@ CLASS_DECLARATION(FilePickerClass, ViewSpawnerClass, NULL) {
{NULL, NULL}
};
void ViewSpawnerClass::FileChosen(str& currentDirectory, str& partialName, str& fullname)
void ViewSpawnerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
{
str newName;
@ -116,7 +116,7 @@ CLASS_DECLARATION(FilePickerClass, LODSpawnerClass, NULL) {
{NULL, NULL}
};
void LODSpawnerClass::FileChosen(str& currentDirectory, str& partialName, str& fullname)
void LODSpawnerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
{
str newName;

View file

@ -27,7 +27,7 @@ class MapRunnerClass : public FilePickerClass
public:
CLASS_PROTOTYPE(MapRunnerClass);
void FileChosen(str& currentDirectory, str& partialName, str& fullname) override;
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
};
class ViewSpawnerClass : public FilePickerClass
@ -35,7 +35,7 @@ class ViewSpawnerClass : public FilePickerClass
public:
CLASS_PROTOTYPE(ViewSpawnerClass);
void FileChosen(str& currentDirectory, str& partialName, str& fullname) override;
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
};
class LODSpawnerClass : public FilePickerClass
@ -43,7 +43,7 @@ class LODSpawnerClass : public FilePickerClass
public:
CLASS_PROTOTYPE(LODSpawnerClass);
void FileChosen(str& currentDirectory, str& partialName, str& fullname) override;
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
};
class UIPickFileClass : public FilePickerClass
@ -57,7 +57,7 @@ public:
UIPickFileClass();
~UIPickFileClass();
void FileChosen(str& currentDirectory, str& partialName, str& fullname) override;
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
};
void PickFile(const char *name, Listener *obj, Event& event);

View file

@ -31,12 +31,12 @@ SoundPickerClass::SoundPickerClass()
// FIXME: stub
}
void SoundPickerClass::FileSelected(str& currentDirectory, str& partialName, str& fullname)
void SoundPickerClass::FileSelected(const str& currentDirectory, const str& partialName, const str& fullname)
{
// FIXME: stub
}
void SoundPickerClass::FileChosen(str& currentDirectory, str& partialName, str& fullname)
void SoundPickerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
{
// FIXME: stub
}

View file

@ -29,6 +29,6 @@ public:
SoundPickerClass();
void FileSelected(str& currentDirectory, str& partialName, str& fullname) override;
void FileChosen(str& currentDirectory, str& partialName, str& fullname) override;
void FileSelected(const str& currentDirectory, const str& partialName, const str& fullname) override;
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
};