Commit c9a1fa06 c9a1fa06415629abfbc181b62432709a032c8254 by Wojciech Polak

Updated to the current API 1.0

1 parent 97fa0963
......@@ -14,7 +14,8 @@
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
INCLUDES = @MU_COMMON_INCLUDES@ @INTLINCS@
......@@ -36,7 +37,6 @@ libmu_cpp_la_SOURCES = \
stream.cc\
url.cc
libmu_cpp_la_DEPENDENCIES = @MU_LTLIBOBJS@
libmu_cpp_la_LIBADD = @MU_LTLIBOBJS@ @MU_COMMON_LIBRARIES@
libmu_cpp_la_LIBADD = @MU_COMMON_LIBRARIES@
libmu_cpp_la_LDFLAGS = -version-info @VI_CURRENT@:@VI_REVISION@:@VI_AGE@
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/address.h>
......@@ -29,12 +30,12 @@ using namespace mailutils;
Address :: Address (const std::string& str)
{
int status = address_create (&addr, str.c_str ());
int status = mu_address_create (&addr, str.c_str ());
if (status)
throw Exception ("Address::Address", status);
}
Address :: Address (const address_t addr)
Address :: Address (const mu_address_t addr)
{
if (addr == 0)
throw Exception ("Address::Address", EINVAL);
......@@ -44,14 +45,14 @@ Address :: Address (const address_t addr)
Address :: ~Address ()
{
address_destroy (&addr);
mu_address_destroy (&addr);
}
bool
Address :: IsGroup (size_t n)
Address :: isGroup (size_t n)
{
int isgroup;
int status = address_is_group (addr, n, &isgroup);
int status = mu_address_is_group (addr, n, &isgroup);
if (status == EINVAL)
throw Address::EInval ("Address::IsGroup", status);
else if (status == ENOENT)
......@@ -61,81 +62,81 @@ Address :: IsGroup (size_t n)
}
size_t
Address :: GetCount ()
Address :: getCount ()
{
size_t count;
address_get_count (addr, &count);
mu_address_get_count (addr, &count);
return count;
}
std::string
Address :: GetEmail (size_t n)
Address :: getEmail (size_t n)
{
int status = address_get_email (addr, n, buf, sizeof (buf), 0);
int status = mu_address_get_email (addr, n, buf, sizeof (buf), 0);
if (status == EINVAL)
throw Address::EInval ("Address::GetEmail", status);
throw Address::EInval ("Address::getEmail", status);
else if (status == ENOENT)
throw Address::ENoent ("Address::GetEmail", status);
throw Address::ENoent ("Address::getEmail", status);
return std::string (buf);
}
std::string
Address :: GetLocalPart (size_t n)
Address :: getLocalPart (size_t n)
{
int status = address_get_local_part (addr, n, buf, sizeof (buf), 0);
int status = mu_address_get_local_part (addr, n, buf, sizeof (buf), 0);
if (status == EINVAL)
throw Address::EInval ("Address::GetLocalPart", status);
throw Address::EInval ("Address::getLocalPart", status);
else if (status == ENOENT)
throw Address::ENoent ("Address::GetLocalPart", status);
throw Address::ENoent ("Address::getLocalPart", status);
return std::string (buf);
}
std::string
Address :: GetDomain (size_t n)
Address :: getDomain (size_t n)
{
int status = address_get_domain (addr, n, buf, sizeof (buf), 0);
int status = mu_address_get_domain (addr, n, buf, sizeof (buf), 0);
if (status == EINVAL)
throw Address::EInval ("Address::GetDomain", status);
throw Address::EInval ("Address::getDomain", status);
else if (status == ENOENT)
throw Address::ENoent ("Address::GetDomain", status);
throw Address::ENoent ("Address::getDomain", status);
return std::string (buf);
}
std::string
Address :: GetPersonal (size_t n)
Address :: getPersonal (size_t n)
{
int status = address_get_personal (addr, n, buf, sizeof (buf), 0);
int status = mu_address_get_personal (addr, n, buf, sizeof (buf), 0);
if (status == EINVAL)
throw Address::EInval ("Address::GetPersonal", status);
throw Address::EInval ("Address::getPersonal", status);
else if (status == ENOENT)
throw Address::ENoent ("Address::GetPersonal", status);
throw Address::ENoent ("Address::getPersonal", status);
return std::string (buf);
}
std::string
Address :: GetComments (size_t n)
Address :: getComments (size_t n)
{
int status = address_get_comments (addr, n, buf, sizeof (buf), 0);
int status = mu_address_get_comments (addr, n, buf, sizeof (buf), 0);
if (status == EINVAL)
throw Address::EInval ("Address::GetComments", status);
throw Address::EInval ("Address::getComments", status);
else if (status == ENOENT)
throw Address::ENoent ("Address::GetComments", status);
throw Address::ENoent ("Address::getComments", status);
return std::string (buf);
}
std::string
Address :: GetRoute (size_t n)
Address :: getRoute (size_t n)
{
int status = address_get_route (addr, n, buf, sizeof (buf), 0);
int status = mu_address_get_route (addr, n, buf, sizeof (buf), 0);
if (status == EINVAL)
throw Address::EInval ("Address::GetRoute", status);
throw Address::EInval ("Address::getRoute", status);
else if (status == ENOENT)
throw Address::ENoent ("Address::GetRoute", status);
throw Address::ENoent ("Address::getRoute", status);
return std::string (buf);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/filter.h>
......@@ -26,32 +27,32 @@ using namespace mailutils;
//
void
FilterStream :: Create (Stream& transport,
FilterStream :: create (Stream& transport,
const std::string& code,
int mode, int flag)
{
int status = filter_create (&this->stm,
int status = mu_filter_create (&this->stm,
transport.stm,
code.c_str (),
mode, flag);
if (status)
throw Exception ("FilterStream::Create", status);
throw Exception ("FilterStream::create", status);
this->input = new Stream (transport);
}
void
FilterStream :: IconvCreate (Stream& transport,
FilterStream :: iconvCreate (Stream& transport,
const std::string& fromcode,
const std::string& tocode,
int flags,
enum mu_iconv_fallback_mode fallback_mode)
{
int status = filter_iconv_create (&this->stm, transport.stm,
int status = mu_filter_iconv_create (&this->stm, transport.stm,
fromcode.c_str (),
tocode.c_str (),
flags, fallback_mode);
if (status)
throw Exception ("FilterStream::IconvCreate", status);
throw Exception ("FilterStream::iconvCreate", status);
this->input = new Stream (transport);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/header.h>
......@@ -31,7 +32,7 @@ Header :: Header ()
{
}
Header :: Header (const header_t hdr)
Header :: Header (const mu_header_t hdr)
{
if (hdr == 0)
throw Exception ("Header::Header", EINVAL);
......@@ -40,13 +41,13 @@ Header :: Header (const header_t hdr)
}
std::string
Header :: GetValue (const std::string& name)
Header :: getValue (const std::string& name)
{
char* c_val;
int status = header_aget_value (hdr, name.c_str (), &c_val);
int status = mu_header_aget_value (hdr, name.c_str (), &c_val);
if (status)
throw Exception ("Header::GetValue", status);
throw Exception ("Header::getValue", status);
std::string val (c_val);
free (c_val);
......@@ -56,6 +57,6 @@ Header :: GetValue (const std::string& name)
std::string
Header :: operator [] (const std::string& name)
{
return this->GetValue (name);
return this->getValue (name);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/iterator.h>
......@@ -29,14 +30,14 @@ using namespace mailutils;
Iterator :: Iterator (const List& lst)
{
int status = list_get_iterator (lst.mu_list, &mu_iter);
int status = mu_list_get_iterator (lst.mu_list, &mu_iter);
if (status)
throw Exception ("Iterator::Iterator", status);
this->pList = (List*) &lst;
}
Iterator :: Iterator (const iterator_t iter)
Iterator :: Iterator (const mu_iterator_t iter)
{
if (iter == 0)
throw Exception ("Iterator::Iterator", EINVAL);
......@@ -47,70 +48,70 @@ Iterator :: Iterator (const iterator_t iter)
Iterator :: ~Iterator ()
{
iterator_destroy (&mu_iter);
mu_iterator_destroy (&mu_iter);
}
void
Iterator :: First ()
Iterator :: first ()
{
iterator_first (mu_iter);
mu_iterator_first (mu_iter);
}
void
Iterator :: Next ()
Iterator :: next ()
{
iterator_next (mu_iter);
mu_iterator_next (mu_iter);
}
Iterator&
Iterator :: operator ++ (int)
{
iterator_next (mu_iter);
mu_iterator_next (mu_iter);
return *this;
}
void
Iterator :: Current (void** pitem)
Iterator :: current (void** pitem)
{
int status = iterator_current (mu_iter, pitem);
int status = mu_iterator_current (mu_iter, pitem);
if (status)
throw Exception ("Iterator::Current", status);
throw Exception ("Iterator::current", status);
}
void*
Iterator :: Current ()
Iterator :: current ()
{
void* pitem;
int status = iterator_current (mu_iter, &pitem);
int status = mu_iterator_current (mu_iter, &pitem);
if (status)
throw Exception ("Iterator::Current", status);
throw Exception ("Iterator::current", status);
return pitem;
}
bool
Iterator :: IsDone ()
Iterator :: isDone ()
{
return (bool) iterator_is_done (mu_iter);
return (bool) mu_iterator_is_done (mu_iter);
}
List&
Iterator :: GetList ()
Iterator :: getList ()
{
if (!pList)
throw Exception ("Iterator::GetList", ENOTSUP);
throw Exception ("Iterator::getList", ENOTSUP);
return *pList;
}
void
Iterator :: Dup (Iterator*& piter, const Iterator& orig)
Iterator :: dup (Iterator*& piter, const Iterator& orig)
{
iterator_t iter;
mu_iterator_t iter;
int status = iterator_dup (&iter, orig.mu_iter);
int status = mu_iterator_dup (&iter, orig.mu_iter);
if (status)
throw Exception ("Iterator::Dup", status);
throw Exception ("Iterator::dup", status);
piter->mu_iter = iter;
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/list.h>
......@@ -29,12 +30,12 @@ using namespace mailutils;
List :: List ()
{
int status = list_create (&mu_list);
int status = mu_list_create (&mu_list);
if (status)
throw Exception ("List::List", status);
}
List :: List (const list_t lst)
List :: List (const mu_list_t lst)
{
if (lst == 0)
throw Exception ("List::List", EINVAL);
......@@ -44,65 +45,65 @@ List :: List (const list_t lst)
List :: ~List ()
{
list_destroy (&mu_list);
mu_list_destroy (&mu_list);
}
void
List :: Append (void* item)
List :: append (void* item)
{
int status = list_append (mu_list, item);
int status = mu_list_append (mu_list, item);
if (status)
throw Exception ("List::Append", status);
throw Exception ("List::append", status);
}
void
List :: Prepend (void* item)
List :: prepend (void* item)
{
int status = list_prepend (mu_list, item);
int status = mu_list_prepend (mu_list, item);
if (status)
throw Exception ("List::Prepend", status);
throw Exception ("List::prepend", status);
}
void
List :: Insert (void* item, void* new_item)
List :: insert (void* item, void* new_item, int insert_before)
{
int status = list_insert (mu_list, item, new_item);
int status = mu_list_insert (mu_list, item, new_item, insert_before);
if (status)
throw Exception ("List::Insert", status);
throw Exception ("List::insert", status);
}
void
List :: Remove (void* item)
List :: remove (void* item)
{
int status = list_remove (mu_list, item);
int status = mu_list_remove (mu_list, item);
if (status)
throw Exception ("List::Remove", status);
throw Exception ("List::remove", status);
}
void
List :: Replace (void* old_item, void* new_item)
List :: replace (void* old_item, void* new_item)
{
int status = list_replace (mu_list, old_item, new_item);
int status = mu_list_replace (mu_list, old_item, new_item);
if (status)
throw Exception ("List::Replace", status);
throw Exception ("List::replace", status);
}
void
List :: Get (size_t index, void** pitem)
List :: get (size_t index, void** pitem)
{
int status = list_get (mu_list, index, pitem);
int status = mu_list_get (mu_list, index, pitem);
if (status)
throw Exception ("List::Get", status);
throw Exception ("List::get", status);
}
void*
List :: Get (size_t index)
List :: get (size_t index)
{
void* pitem;
int status = list_get (mu_list, index, &pitem);
int status = mu_list_get (mu_list, index, &pitem);
if (status)
throw Exception ("List::Get", status);
throw Exception ("List::get", status);
return pitem;
}
......@@ -110,62 +111,62 @@ List :: Get (size_t index)
void*
List :: operator [] (size_t index)
{
return this->Get (index);
return this->get (index);
}
void
List :: ToArray (void** array, size_t count, size_t* pcount)
List :: toArray (void** array, size_t count, size_t* pcount)
{
int status = list_to_array (mu_list, array, count, pcount);
int status = mu_list_to_array (mu_list, array, count, pcount);
if (status)
throw Exception ("List::ToArray", status);
throw Exception ("List::toArray", status);
}
void
List :: Locate (void* item, void** ret_item)
List :: locate (void* item, void** ret_item)
{
int status = list_locate (mu_list, item, ret_item);
int status = mu_list_locate (mu_list, item, ret_item);
if (status)
throw Exception ("List::Locate", status);
throw Exception ("List::locate", status);
}
bool
List :: IsEmpty ()
List :: isEmpty ()
{
return (bool) list_is_empty (mu_list);
return (bool) mu_list_is_empty (mu_list);
}
size_t
List :: Count ()
List :: count ()
{
size_t count = 0;
int status = list_count (mu_list, &count);
int status = mu_list_count (mu_list, &count);
if (status)
throw Exception ("List::Count", status);
throw Exception ("List::count", status);
return count;
}
void
List :: Do (list_action_t* action, void* cbdata)
List :: apply (mu_list_action_t* action, void* cbdata)
{
int status = list_do (mu_list, action, cbdata);
int status = mu_list_do (mu_list, action, cbdata);
if (status)
throw Exception ("List::Do", status);
throw Exception ("List::apply", status);
}
list_comparator_t
List :: SetComparator (list_comparator_t comp)
mu_list_comparator_t
List :: setComparator (mu_list_comparator_t comp)
{
return list_set_comparator (mu_list, comp);
return mu_list_set_comparator (mu_list, comp);
}
void
List :: SetDestroyItem (void (*destroy_item) (void *item))
List :: setDestroyItem (void (*mu_destroy_item) (void *item))
{
int status = list_set_destroy_item (mu_list, destroy_item);
int status = mu_list_set_destroy_item (mu_list, mu_destroy_item);
if (status)
throw Exception ("List::SetDestroyItem", status);
throw Exception ("List::setDestroyItem", status);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/mailbox.h>
......@@ -29,37 +30,37 @@ using namespace mailutils;
//
void
MailboxBase :: Open (int flag)
MailboxBase :: open (int flag)
{
int status = mailbox_open (mbox, flag);
int status = mu_mailbox_open (mbox, flag);
if (status)
throw Exception ("MailboxBase::Open", status);
throw Exception ("MailboxBase::open", status);
}
void
MailboxBase :: Close ()
MailboxBase :: close ()
{
int status = mailbox_close (mbox);
int status = mu_mailbox_close (mbox);
if (status)
throw Exception ("MailboxBase::Close", status);
throw Exception ("MailboxBase::close", status);
}
size_t
MailboxBase :: MessagesCount ()
MailboxBase :: messagesCount ()
{
size_t total;
mailbox_messages_count (mbox, &total);
mu_mailbox_messages_count (mbox, &total);
return total;
}
Message&
MailboxBase :: GetMessage (size_t num)
MailboxBase :: getMessage (size_t num)
{
message_t c_msg;
mu_message_t c_msg;
int status = mailbox_get_message (mbox, num, &c_msg);
int status = mu_mailbox_get_message (mbox, num, &c_msg);
if (status)
throw Exception ("MailboxBase::GetMessage", status);
throw Exception ("MailboxBase::getMessage", status);
return *new Message (c_msg);
}
......@@ -67,7 +68,7 @@ MailboxBase :: GetMessage (size_t num)
Message&
MailboxBase :: operator [] (size_t num)
{
return this->GetMessage (num);
return this->getMessage (num);
}
//
......@@ -76,12 +77,12 @@ MailboxBase :: operator [] (size_t num)
Mailbox :: Mailbox (const std::string& name)
{
int status = mailbox_create (&mbox, name.c_str ());
int status = mu_mailbox_create (&mbox, name.c_str ());
if (status)
throw Exception ("Mailbox::Mailbox", status);
}
Mailbox :: Mailbox (const mailbox_t mbox)
Mailbox :: Mailbox (const mu_mailbox_t mbox)
{
if (mbox == 0)
throw Exception ("Mailbox::Mailbox", EINVAL);
......@@ -91,7 +92,7 @@ Mailbox :: Mailbox (const mailbox_t mbox)
Mailbox :: ~Mailbox ()
{
mailbox_destroy (&mbox);
mu_mailbox_destroy (&mbox);
}
//
......@@ -100,12 +101,12 @@ Mailbox :: ~Mailbox ()
MailboxDefault :: MailboxDefault (const std::string& name)
{
int status = mailbox_create_default (&mbox, name.c_str ());
int status = mu_mailbox_create_default (&mbox, name.c_str ());
if (status)
throw Exception ("MailboxDefault::MailboxDefault", status);
}
MailboxDefault :: MailboxDefault (const mailbox_t mbox)
MailboxDefault :: MailboxDefault (const mu_mailbox_t mbox)
{
if (mbox == 0)
throw Exception ("MailboxDefault::MailboxDefault", EINVAL);
......@@ -115,6 +116,6 @@ MailboxDefault :: MailboxDefault (const mailbox_t mbox)
MailboxDefault :: ~MailboxDefault ()
{
mailbox_destroy (&mbox);
mu_mailbox_destroy (&mbox);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/mailcap.h>
......@@ -49,23 +50,23 @@ Mailcap :: ~Mailcap ()
}
size_t
Mailcap :: GetCount ()
Mailcap :: getCount ()
{
size_t count = 0;
int status = mu_mailcap_entries_count (mailcap, &count);
if (status)
throw Exception ("Mailcap::GetCount", status);
throw Exception ("Mailcap::getCount", status);
return count;
}
MailcapEntry&
Mailcap :: GetEntry (size_t i)
Mailcap :: getEntry (size_t i)
{
mu_mailcap_entry_t c_entry;
int status = mu_mailcap_get_entry (mailcap, i, &c_entry);
if (status)
throw Exception ("Mailcap::GetEntry", status);
throw Exception ("Mailcap::getEntry", status);
MailcapEntry* entry = new MailcapEntry (c_entry);
return *entry;
......@@ -84,42 +85,42 @@ MailcapEntry :: MailcapEntry (mu_mailcap_entry_t entry)
}
size_t
MailcapEntry :: FieldsCount ()
MailcapEntry :: fieldsCount ()
{
size_t count = 0;
int status = mu_mailcap_entry_fields_count (entry, &count);
if (status)
throw Exception ("MailcapEntry::FieldsCount", status);
throw Exception ("MailcapEntry::fieldsCount", status);
return count;
}
std::string
MailcapEntry :: GetField (size_t i)
MailcapEntry :: getField (size_t i)
{
int status = mu_mailcap_entry_get_field (entry, i, buf,
sizeof (buf), NULL);
if (status)
throw Exception ("MailcapEntry::GetField", status);
throw Exception ("MailcapEntry::getField", status);
return std::string (buf);
}
std::string
MailcapEntry :: GetTypeField ()
MailcapEntry :: getTypeField ()
{
int status = mu_mailcap_entry_get_typefield (entry, buf,
sizeof (buf), NULL);
if (status)
throw Exception ("MailcapEntry::GetTypeField", status);
throw Exception ("MailcapEntry::getTypeField", status);
return std::string (buf);
}
std::string
MailcapEntry :: GetViewCommand ()
MailcapEntry :: getViewCommand ()
{
int status = mu_mailcap_entry_get_viewcommand (entry, buf,
sizeof (buf), NULL);
if (status)
throw Exception ("MailcapEntry::GetViewCommand", status);
throw Exception ("MailcapEntry::getViewCommand", status);
return std::string (buf);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/mailer.h>
......@@ -28,12 +29,12 @@ using namespace mailutils;
Mailer :: Mailer (const std::string& url)
{
int status = mailer_create (&mailer, url.c_str ());
int status = mu_mailer_create (&mailer, url.c_str ());
if (status)
throw Exception ("Mailer::Mailer", status);
}
Mailer :: Mailer (const mailer_t mailer)
Mailer :: Mailer (const mu_mailer_t mailer)
{
if (mailer == 0)
throw Exception ("Mailer::Mailer", EINVAL);
......@@ -43,32 +44,32 @@ Mailer :: Mailer (const mailer_t mailer)
Mailer :: ~Mailer ()
{
mailer_destroy (&mailer);
mu_mailer_destroy (&mailer);
}
void
Mailer :: Open (int flags)
Mailer :: open (int flags)
{
int status = mailer_open (mailer, flags);
int status = mu_mailer_open (mailer, flags);
if (status)
throw Exception ("Mailer::Open", status);
throw Exception ("Mailer::open", status);
}
void
Mailer :: Close ()
Mailer :: close ()
{
int status = mailer_close (mailer);
int status = mu_mailer_close (mailer);
if (status)
throw Exception ("Mailer::Close", status);
throw Exception ("Mailer::close", status);
}
void
Mailer :: SendMessage (const Message& msg, const Address& from,
Mailer :: sendMessage (const Message& msg, const Address& from,
const Address& to)
{
int status = mailer_send_message (mailer, msg.msg,
int status = mu_mailer_send_message (mailer, msg.msg,
from.addr, to.addr);
if (status)
throw Exception ("Mailer::SendMessage", status);
throw Exception ("Mailer::sendMessage", status);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/message.h>
......@@ -32,7 +33,7 @@ Message :: Message ()
{
}
Message :: Message (const message_t msg)
Message :: Message (const mu_message_t msg)
{
if (msg == 0)
throw Exception ("Message::Message", EINVAL);
......@@ -41,13 +42,13 @@ Message :: Message (const message_t msg)
}
Header&
Message :: GetHeader ()
Message :: getHeader ()
{
header_t c_hdr;
mu_header_t c_hdr;
int status = message_get_header (msg, &c_hdr);
int status = mu_message_get_header (msg, &c_hdr);
if (status)
throw Exception ("Message::GetHeader", status);
throw Exception ("Message::getHeader", status);
return *new Header (c_hdr);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/pop3.h>
......@@ -51,214 +52,214 @@ Pop3 :: ~Pop3 ()
}
void
Pop3 :: SetCarrier (const Stream& carrier)
Pop3 :: setCarrier (const Stream& carrier)
{
int status = mu_pop3_set_carrier (pop3, carrier.stm);
if (status)
throw Exception ("Pop3::SetCarrier", status);
throw Exception ("Pop3::setCarrier", status);
this->pStream = (Stream*) &carrier;
}
Stream&
Pop3 :: GetCarrier ()
Pop3 :: getCarrier ()
{
return *pStream;
}
void
Pop3 :: Connect ()
Pop3 :: connect ()
{
int status = mu_pop3_connect (pop3);
if (status)
throw Exception ("Pop3::Connect", status);
throw Exception ("Pop3::connect", status);
}
void
Pop3 :: Disconnect ()
Pop3 :: disconnect ()
{
int status = mu_pop3_disconnect (pop3);
if (status)
throw Exception ("Pop3::Disconnect", status);
throw Exception ("Pop3::disconnect", status);
}
void
Pop3 :: SetTimeout (int timeout)
Pop3 :: setTimeout (int timeout)
{
int status = mu_pop3_set_timeout (pop3, timeout);
if (status)
throw Exception ("Pop3::SetTimeout", status);
throw Exception ("Pop3::setTimeout", status);
}
int
Pop3 :: GetTimeout ()
Pop3 :: getTimeout ()
{
int timeout;
int status = mu_pop3_get_timeout (pop3, &timeout);
if (status)
throw Exception ("Pop3::GetTimeout", status);
throw Exception ("Pop3::getTimeout", status);
return timeout;
}
void
Pop3 :: Stls ()
Pop3 :: stls ()
{
int status = mu_pop3_stls (pop3);
if (status)
throw Exception ("Pop3::Stls", status);
throw Exception ("Pop3::stls", status);
}
Iterator&
Pop3 :: Capa ()
Pop3 :: capa ()
{
iterator_t mu_itr;
mu_iterator_t mu_itr;
int status = mu_pop3_capa (pop3, &mu_itr);
if (status)
throw Exception ("Pop3::Capa", status);
throw Exception ("Pop3::capa", status);
return *new Iterator (mu_itr);
}
void
Pop3 :: Dele (unsigned int msgno)
Pop3 :: dele (unsigned int msgno)
{
int status = mu_pop3_dele (pop3, msgno);
if (status)
throw Exception ("Pop3::Dele", status);
throw Exception ("Pop3::dele", status);
}
size_t
Pop3 :: List (unsigned int msgno)
Pop3 :: list (unsigned int msgno)
{
size_t msg_octet;
int status = mu_pop3_list (pop3, msgno, &msg_octet);
if (status)
throw Exception ("Pop3::List", status);
throw Exception ("Pop3::list", status);
return msg_octet;
}
Iterator&
Pop3 :: ListAll ()
Pop3 :: listAll ()
{
iterator_t mu_itr;
mu_iterator_t mu_itr;
int status = mu_pop3_list_all (pop3, &mu_itr);
if (status)
throw Exception ("Pop3::ListAll", status);
throw Exception ("Pop3::listAll", status);
return *new Iterator (mu_itr);
}
void
Pop3 :: Noop ()
Pop3 :: noop ()
{
int status = mu_pop3_noop (pop3);
if (status)
throw Exception ("Pop3::Noop", status);
throw Exception ("Pop3::noop", status);
}
void
Pop3 :: Pass (const char* pass)
Pop3 :: pass (const char* pass)
{
int status = mu_pop3_pass (pop3, pass);
if (status)
throw Exception ("Pop3::Pass", status);
throw Exception ("Pop3::pass", status);
}
void
Pop3 :: Quit ()
Pop3 :: quit ()
{
int status = mu_pop3_quit (pop3);
if (status)
throw Exception ("Pop3::Quit", status);
throw Exception ("Pop3::quit", status);
}
Stream&
Pop3 :: Retr (unsigned int msgno)
Pop3 :: retr (unsigned int msgno)
{
stream_t c_stm;
mu_stream_t c_stm;
int status = mu_pop3_retr (pop3, msgno, &c_stm);
if (status)
throw Exception ("Pop3::Retr", status);
throw Exception ("Pop3::retr", status);
return *new Stream (c_stm);
}
void
Pop3 :: Rset ()
Pop3 :: rset ()
{
int status = mu_pop3_rset (pop3);
if (status)
throw Exception ("Pop3::Rset", status);
throw Exception ("Pop3::rset", status);
}
void
Pop3 :: Stat (unsigned int* count, size_t* octets)
Pop3 :: stat (unsigned int* count, size_t* octets)
{
int status = mu_pop3_stat (pop3, count, octets);
if (status)
throw Exception ("Pop3::Stat", status);
throw Exception ("Pop3::stat", status);
}
Stream&
Pop3 :: Top (unsigned int msgno, unsigned int lines)
Pop3 :: top (unsigned int msgno, unsigned int lines)
{
stream_t c_stm;
mu_stream_t c_stm;
int status = mu_pop3_top (pop3, msgno, lines, &c_stm);
if (status)
throw Exception ("Pop3::Top", status);
throw Exception ("Pop3::top", status);
return *new Stream (c_stm);
}
void
Pop3 :: User (const char* user)
Pop3 :: user (const char* user)
{
int status = mu_pop3_user (pop3, user);
if (status)
throw Exception ("Pop3::User", status);
throw Exception ("Pop3::user", status);
}
size_t
Pop3 :: ReadLine (char* buf, size_t buflen)
Pop3 :: readLine (char* buf, size_t buflen)
{
size_t nread;
int status = mu_pop3_readline (pop3, buf, buflen, &nread);
if (status)
throw Exception ("Pop3::ReadLine", status);
throw Exception ("Pop3::readLine", status);
}
size_t
Pop3 :: Response (char* buf, size_t buflen)
Pop3 :: response (char* buf, size_t buflen)
{
size_t nread;
int status = mu_pop3_response (pop3, buf, buflen, &nread);
if (status)
throw Exception ("Pop3::Response", status);
throw Exception ("Pop3::response", status);
}
void
Pop3 :: SendLine (const char* line)
Pop3 :: sendLine (const char* line)
{
int status = mu_pop3_sendline (pop3, line);
if (status)
throw Exception ("Pop3::SendLine", status);
throw Exception ("Pop3::sendLine", status);
}
void
Pop3 :: Send ()
Pop3 :: send ()
{
int status = mu_pop3_send (pop3);
if (status)
throw Exception ("Pop3::Send", status);
throw Exception ("Pop3::send", status);
}
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/stream.h>
......@@ -33,7 +34,7 @@ Stream :: Stream ()
reference ();
}
Stream :: Stream (const stream_t stm)
Stream :: Stream (const mu_stream_t stm)
{
if (stm == 0)
throw Exception ("Stream::Stream", EINVAL);
......@@ -53,112 +54,112 @@ Stream :: ~Stream ()
{
if (dereference ())
{
Close ();
close ();
if (this->stm)
stream_destroy (&stm, NULL);
mu_stream_destroy (&stm, NULL);
}
}
void
Stream :: Open ()
Stream :: open ()
{
int status = stream_open (stm);
int status = mu_stream_open (stm);
if (status == EAGAIN)
throw Stream::EAgain ("Stream::Open", status);
throw Stream::EAgain ("Stream::open", status);
else if (status)
throw Exception ("Stream::Open", status);
throw Exception ("Stream::open", status);
this->opened = true;
}
void
Stream :: Close ()
Stream :: close ()
{
if (this->opened)
{
int status = stream_close (stm);
int status = mu_stream_close (stm);
if (status)
throw Exception ("Stream::Close", status);
throw Exception ("Stream::close", status);
this->opened = false;
}
}
void
Stream :: SetWaitFlags (int flags)
Stream :: setWaitFlags (int flags)
{
this->wflags = flags;
}
void
Stream :: Wait ()
Stream :: wait ()
{
int status = stream_wait (stm, &wflags, NULL);
int status = mu_stream_wait (stm, &wflags, NULL);
if (status)
throw Exception ("Stream::Wait", status);
throw Exception ("Stream::wait", status);
}
void
Stream :: Wait (int flags)
Stream :: wait (int flags)
{
this->wflags = flags;
int status = stream_wait (stm, &wflags, NULL);
int status = mu_stream_wait (stm, &wflags, NULL);
if (status)
throw Exception ("Stream::Wait", status);
throw Exception ("Stream::wait", status);
}
void
Stream :: Read (char* rbuf, size_t size, off_t offset)
Stream :: read (char* rbuf, size_t size, off_t offset)
{
int status = stream_read (stm, rbuf, size, offset, &readn);
int status = mu_stream_read (stm, rbuf, size, offset, &readn);
if (status == EAGAIN)
throw Stream::EAgain ("Stream::Read", status);
throw Stream::EAgain ("Stream::read", status);
else if (status)
throw Exception ("Stream::Read", status);
throw Exception ("Stream::read", status);
}
void
Stream :: Write (const std::string& wbuf, size_t size, off_t offset)
Stream :: write (const std::string& wbuf, size_t size, off_t offset)
{
int status = stream_write (stm, wbuf.c_str (), size, offset, &writen);
int status = mu_stream_write (stm, wbuf.c_str (), size, offset, &writen);
if (status == EAGAIN)
throw Stream::EAgain ("Stream::Write", status);
throw Stream::EAgain ("Stream::write", status);
else if (status)
throw Exception ("Stream::Write", status);
throw Exception ("Stream::write", status);
}
void
Stream :: ReadLine (char* rbuf, size_t size, off_t offset)
Stream :: readLine (char* rbuf, size_t size, off_t offset)
{
int status = stream_readline (stm, rbuf, size, offset, &readn);
int status = mu_stream_readline (stm, rbuf, size, offset, &readn);
if (status == EAGAIN)
throw Stream::EAgain ("Stream::ReadLine", status);
throw Stream::EAgain ("Stream::readLine", status);
else if (status)
throw Exception ("Stream::ReadLine", status);
throw Exception ("Stream::readLine", status);
}
void
Stream :: SequentialReadLine (char* rbuf, size_t size)
Stream :: sequentialReadLine (char* rbuf, size_t size)
{
int status = stream_sequential_readline (stm, rbuf, size, &readn);
int status = mu_stream_sequential_readline (stm, rbuf, size, &readn);
if (status)
throw Exception ("Stream::SequentialReadLine", status);
throw Exception ("Stream::sequentialReadLine", status);
}
void
Stream :: SequentialWrite (const std::string& wbuf, size_t size)
Stream :: sequentialWrite (const std::string& wbuf, size_t size)
{
int status = stream_sequential_write (stm, wbuf.c_str (), size);
int status = mu_stream_sequential_write (stm, wbuf.c_str (), size);
if (status)
throw Exception ("Stream::SequentialWrite", status);
throw Exception ("Stream::sequentialWrite", status);
}
void
Stream :: Flush ()
Stream :: flush ()
{
int status = stream_flush (stm);
int status = mu_stream_flush (stm);
if (status)
throw Exception ("Stream::Flush", status);
throw Exception ("Stream::flush", status);
}
namespace mailutils
......@@ -166,7 +167,7 @@ namespace mailutils
Stream&
operator << (Stream& stm, const std::string& wbuf)
{
stm.Write (wbuf, wbuf.length (), 0);
stm.write (wbuf, wbuf.length (), 0);
return stm;
}
......@@ -174,7 +175,7 @@ namespace mailutils
operator >> (Stream& stm, std::string& rbuf)
{
char tmp[1024];
stm.Read (tmp, sizeof (tmp), 0);
stm.read (tmp, sizeof (tmp), 0);
rbuf = std::string (tmp);
return stm;
}
......@@ -186,7 +187,7 @@ namespace mailutils
TcpStream :: TcpStream (const std::string& host, int port, int flags)
{
int status = tcp_stream_create (&stm, host.c_str (), port, flags);
int status = mu_tcp_stream_create (&stm, host.c_str (), port, flags);
if (status)
throw Exception ("TcpStream::TcpStream", status);
}
......@@ -197,7 +198,7 @@ TcpStream :: TcpStream (const std::string& host, int port, int flags)
FileStream :: FileStream (const std::string& filename, int flags)
{
int status = file_stream_create (&stm, filename.c_str (), flags);
int status = mu_file_stream_create (&stm, filename.c_str (), flags);
if (status)
throw Exception ("FileStream::FileStream", status);
}
......@@ -208,7 +209,7 @@ FileStream :: FileStream (const std::string& filename, int flags)
StdioStream :: StdioStream (FILE* fp, int flags)
{
int status = stdio_stream_create (&stm, fp, flags);
int status = mu_stdio_stream_create (&stm, fp, flags);
if (status)
throw Exception ("StdioStream::StdioStream", status);
}
......@@ -219,7 +220,7 @@ StdioStream :: StdioStream (FILE* fp, int flags)
ProgStream :: ProgStream (const std::string& progname, int flags)
{
int status = prog_stream_create (&stm, progname.c_str (), flags);
int status = mu_prog_stream_create (&stm, progname.c_str (), flags);
if (status)
throw Exception ("ProgStream::ProgStream", status);
}
......@@ -231,7 +232,7 @@ ProgStream :: ProgStream (const std::string& progname, int flags)
FilterProgStream :: FilterProgStream (const std::string& progname,
Stream& input)
{
int status = filter_prog_stream_create (&stm, progname.c_str (),
int status = mu_filter_prog_stream_create (&stm, progname.c_str (),
input.stm);
this->input = new Stream (input);
if (status)
......@@ -241,7 +242,7 @@ FilterProgStream :: FilterProgStream (const std::string& progname,
FilterProgStream :: FilterProgStream (const std::string& progname,
Stream* input)
{
int status = filter_prog_stream_create (&stm, progname.c_str (),
int status = mu_filter_prog_stream_create (&stm, progname.c_str (),
input->stm);
this->input = new Stream (*input);
if (status)
......
/*
GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -12,9 +12,10 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
*/
#include <mailutils/cpp/url.h>
......@@ -29,19 +30,19 @@ using namespace mailutils;
Url :: Url (const std::string& str)
{
int status = url_create (&url, str.c_str ());
int status = mu_url_create (&url, str.c_str ());
if (status)
throw Exception ("Url::Url", status);
}
Url :: Url (const char* str)
{
int status = url_create (&url, str);
int status = mu_url_create (&url, str);
if (status)
throw Exception ("Url::Url", status);
}
Url :: Url (const url_t url)
Url :: Url (const mu_url_t url)
{
if (url == 0)
throw Exception ("Url::Url", EINVAL);
......@@ -51,87 +52,87 @@ Url :: Url (const url_t url)
Url :: ~Url ()
{
url_destroy (&url);
mu_url_destroy (&url);
}
void
Url :: Parse ()
Url :: parse ()
{
int status = url_parse (url);
int status = mu_url_parse (url);
if (status)
throw Exception ("Url::Parse", status);
throw Exception ("Url::parse", status);
}
long
Url :: GetPort ()
Url :: getPort ()
{
long port;
int status = url_get_port (url, &port);
int status = mu_url_get_port (url, &port);
if (status)
throw Exception ("Url::GetPort", status);
throw Exception ("Url::getPort", status);
return port;
}
std::string
Url :: GetScheme ()
Url :: getScheme ()
{
int status = url_get_scheme (url, buf, sizeof (buf), NULL);
int status = mu_url_get_scheme (url, buf, sizeof (buf), NULL);
if (status)
throw Exception ("Url::GetScheme", status);
throw Exception ("Url::getScheme", status);
return std::string (buf);
}
std::string
Url :: GetUser ()
Url :: getUser ()
{
int status = url_get_user (url, buf, sizeof (buf), NULL);
int status = mu_url_get_user (url, buf, sizeof (buf), NULL);
if (status)
throw Exception ("Url::GetUser", status);
throw Exception ("Url::getUser", status);
return std::string (buf);
}
std::string
Url :: GetPasswd ()
Url :: getPasswd ()
{
int status = url_get_passwd (url, buf, sizeof (buf), NULL);
int status = mu_url_get_passwd (url, buf, sizeof (buf), NULL);
if (status)
throw Exception ("Url::GetPasswd", status);
throw Exception ("Url::getPasswd", status);
return std::string (buf);
}
std::string
Url :: GetAuth ()
Url :: getAuth ()
{
int status = url_get_auth (url, buf, sizeof (buf), NULL);
int status = mu_url_get_auth (url, buf, sizeof (buf), NULL);
if (status)
throw Exception ("Url::GetAuth", status);
throw Exception ("Url::getAuth", status);
return std::string (buf);
}
std::string
Url :: GetHost ()
Url :: getHost ()
{
int status = url_get_host (url, buf, sizeof (buf), NULL);
int status = mu_url_get_host (url, buf, sizeof (buf), NULL);
if (status)
throw Exception ("Url::GetHost", status);
throw Exception ("Url::getHost", status);
return std::string (buf);
}
std::string
Url :: GetPath ()
Url :: getPath ()
{
int status = url_get_path (url, buf, sizeof (buf), NULL);
int status = mu_url_get_path (url, buf, sizeof (buf), NULL);
if (status)
throw Exception ("Url::GetPath", status);
throw Exception ("Url::getPath", status);
return std::string (buf);
}
std::string
Url :: GetQuery ()
Url :: getQuery ()
{
int status = url_get_query (url, buf, sizeof (buf), NULL);
int status = mu_url_get_query (url, buf, sizeof (buf), NULL);
if (status)
throw Exception ("Url::GetQuery", status);
throw Exception ("Url::getQuery", status);
return std::string (buf);
}
......