Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
45 user(s) are online (30 user(s) are browsing Forums)

Members: 2
Guests: 43

broadblues, Belxjander, more...

Support us!

Headlines

Report message:*
 

Re: Porting to AmigaOS4 thread

Subject: Re: Porting to AmigaOS4 thread
by Capehill on 2020/11/23 8:14:31

@Raziel

Regarding const, I meant something like:

Quote:

- Header:

class AmigaOSDialogManager : public Common::DialogManager {
...
private:
char *utf8ToLocal(const char *in);
};

- Implementation:

char *AmigaOSDialogManager::utf8ToLocal(const char *in) {
...
}


Common::DialogManager::DialogResult AmigaOSDialogManager::showFileBrowser(const Common::U32String &title, Common::FSNode &choice, bool isDirBrowser) {

...
char *newTitle = utf8ToLocal(utf8Title.c_str());

...
}


In short, pass const char* as input (it's supposed to be read-only data). Return value should be just char* if this data is going to be free()'d.



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project