[ libetpan-Feature Requests-1163923 ] C++ friendly interface
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.mail.libetpan.user |
|---|---|
| Message-ID | <[email protected]> |
Feature Requests item #1163923, was opened at 2005-03-15 10:12
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=429699&aid=1163923&group_id=41064
Category: Interface
Group: libEtPan!
Status: Open
Priority: 5
Submitted By: David Gal (davidgal)
Assigned to: Nobody/Anonymous (nobody)
Summary: C++ friendly interface
Initial Comment:
Interface functions that take "char*" parameters should
be changed to take "const char*" parameters where
appropriate. This would certainly making linking to C++
applications easier.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2005-03-16 01:39
Message:
Logged In: NO
I've only just started looking at the library so don't know it in
any huge detail at the moment.
It's not even really a C++ issue just more likely to come up
because if you use strings in C++ then to pass that string to
a function that deals with C style strings you use string.c_str
() which returns a const char*. If you're not changing the C
string you're being passed then there's no reason the
parameter shouldn't be typed const char*.
for example:
void connect(const char* user, const char* password)
{
.
.
pop3_mailstorage_init(storage, server, 0, 0,
CONNECTION_TYPE_PLAIN, POP3_AUTH_TYPE_PLAIN,
user, password, 0, 0, 0);
.
.
}
gives the following compiler error:
In function `void connect(const char*, const char*)':
invalid conversion from `const char*' to `char*'
invalid conversion from `const char*' to `char*'
Hope that makes things a little clearer.
----------------------------------------------------------------------
Comment By: DINH V. Hoa (hoa)
Date: 2005-03-15 15:44
Message:
Logged In: YES
user_id=201468
Could you give more details about functions that take char *
that will not be friendly ?
And a patch will allow the feature request to be completed
quicker.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=429699&aid=1163923&group_id=41064
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click