[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

RE: [XaraXtreme-dev] Re: [XaraXtreme-commits] Commit Complete



Indeed.  A first draft edit of the docs is on the documentation page on
the web site.  It will be extended tonight/tomorrow to include more
detail about what should and shouldn't be used.

Basically, you should now always just use %s (or %c) which means a TCHAR
string in the camSprintf type functions though this does mean that you
can't write a char string using them.  E.g. you can't do:

TCHAR* buf;
char* pascii;
camSprintf(buf, _T("Hello %s"), pascii);

I believe you can still do:

TCHAR* buf;
wchar_t* pwide;
camSprintf(buf, _T("Hello %ls"), pwide);

though I am not totally sure this will be completely portable so should
probably be avoided.

Any code that relies on this sort of thing should probably be changed to
convert the strings before formatting, or else use a different mechanism
to build up the string.

There are still some bits of code that have survived my purge (the cc_
type functions spring to mind) and still need cleaning up.

Gerry

-----Original Message-----
From: owner-dev@xxxxxxxxxxxxxxxx [mailto:owner-dev@xxxxxxxxxxxxxxxx] On
Behalf Of Alex Bligh
Sent: 18 April 2006 18:01
To: xara-dev
Cc: Alex Bligh
Subject: [XaraXtreme-dev] Re: [XaraXtreme-commits] Commit Complete

Gerry,

--On 18 April 2006 17:06 +0100 subversion@xxxxxxxxxxxxxx wrote:

> Rationalised string handling

Thanks for that. Layers now have names in the layer gallery...

Is there some documentation somewhere which now tells us when we
need %s, %ls, %c, %lc? (I presume the answer is that if the
output string is unicode, %s always means a unicode input string,
but somewhere there must be a list of functions to call or
avoid calling - for instance wsnprintf won't do that, but did
you fix tsprintf - etc. - some docs would help).

Alex