Opened 7 years ago
Closed 7 years ago
#6726 closed enhancement (invalid)
Add printf style constructor to CPLString
Reported by: | Lucian Plesea | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | CPLString |
Cc: |
Description
CPLString and it's associated Printf method are often chained together to produce a temporary string, to the point that a new function, CPLOPrintf was introduced. This patch provides a CPLString formatting constructor, which also replaces the zero terminated string assignment constructor.
Attachments (1)
Change History (3)
comment:1 by , 7 years ago
by , 7 years ago
Attachment: | CPLString.patch added |
---|
comment:2 by , 7 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Ah, yes, didn't think of that one case, I was too happy that I got it working. One could use the append() in that case, but that would be too much.
Note:
See TracTickets
for help on using tickets.
I'm afraid we can't just remove the CPLString( const char *pszStr ) constructor, in case something would rely on copying a string that would contain the % character. Now that could cause segfaults.