[libsoupmm] Add Soup::CookieJarText
- From: Siavash Safi <siavashs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libsoupmm] Add Soup::CookieJarText
- Date: Thu, 3 Sep 2009 13:57:39 +0000 (UTC)
commit a180803c1bb9fe9fe9ccf41a5e138d8d6eee6a57
Author: Siavash Safi <siavash siavashs org>
Date: Thu Sep 3 18:23:21 2009 +0430
Add Soup::CookieJarText
* codegen/extradefs/generate_extra_defs_libsoup.cc: Add
SOUP_TYPE_COOKIE_JAR_TEXT
* libsoup/.gitignore:
* libsoup/libsoupmm.h:
* libsoup/src/cookie-jar-text.ccg:
* libsoup/src/cookie-jar-text.hg:
* libsoup/src/filelist.am: Add cookie-jar-text.hg
* libsoup/src/libsoup_signals.defs: Regenerate
codegen/extradefs/generate_extra_defs_libsoup.cc | 1 +
libsoup/.gitignore | 2 +
libsoup/libsoupmm.h | 1 +
libsoup/src/cookie-jar-text.ccg | 22 ++++++++++
libsoup/src/cookie-jar-text.hg | 47 ++++++++++++++++++++++
libsoup/src/filelist.am | 2 +-
libsoup/src/libsoup_signals.defs | 20 +++++++++
7 files changed, 94 insertions(+), 1 deletions(-)
---
diff --git a/codegen/extradefs/generate_extra_defs_libsoup.cc b/codegen/extradefs/generate_extra_defs_libsoup.cc
index 4b87d00..3a6e6fb 100644
--- a/codegen/extradefs/generate_extra_defs_libsoup.cc
+++ b/codegen/extradefs/generate_extra_defs_libsoup.cc
@@ -29,6 +29,7 @@ int main(int, char**)
std::cout << get_defs(SOUP_TYPE_ADDRESS);
std::cout << get_defs(SOUP_TYPE_AUTH);
std::cout << get_defs(SOUP_TYPE_COOKIE_JAR);
+ std::cout << get_defs(SOUP_TYPE_COOKIE_JAR_TEXT);
std::cout << get_defs(SOUP_TYPE_MESSAGE);
std::cout << get_defs(SOUP_TYPE_SESSION);
std::cout << get_defs(SOUP_TYPE_SERVER);
diff --git a/libsoup/.gitignore b/libsoup/.gitignore
index 3ad855e..4984724 100644
--- a/libsoup/.gitignore
+++ b/libsoup/.gitignore
@@ -8,6 +8,8 @@
/libsoupmm/cookie.h
/libsoupmm/cookie-jar.cc
/libsoupmm/cookie-jar.h
+/libsoupmm/cookie-jar-text.cc
+/libsoupmm/cookie-jar-text.h
/libsoupmm/enums.cc
/libsoupmm/enums.h
/libsoupmm/message.cc
diff --git a/libsoup/libsoupmm.h b/libsoup/libsoupmm.h
index 35660b2..c026f9f 100644
--- a/libsoup/libsoupmm.h
+++ b/libsoup/libsoupmm.h
@@ -27,6 +27,7 @@
#include <libsoupmm/auth.h>
#include <libsoupmm/cookie.h>
#include <libsoupmm/cookie-jar.h>
+#include <libsoupmm/cookie-jar-text.h>
#include <libsoupmm/enums.h>
#include <libsoupmm/form.h>
#include <libsoupmm/message.h>
diff --git a/libsoup/src/cookie-jar-text.ccg b/libsoup/src/cookie-jar-text.ccg
new file mode 100644
index 0000000..602b24d
--- /dev/null
+++ b/libsoup/src/cookie-jar-text.ccg
@@ -0,0 +1,22 @@
+/* Copyright (c) 2009 Siavash Safi <siavashs siavashs org>
+ *
+ * This file is part of libsoupmm.
+ *
+ * libsoupmm is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 2.1 of the License,
+ * or (at your option) any later version.
+ *
+ * libsoupmm is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * 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 program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace Soup
+{
+
+} // namespace Soup
diff --git a/libsoup/src/cookie-jar-text.hg b/libsoup/src/cookie-jar-text.hg
new file mode 100644
index 0000000..4d52ef7
--- /dev/null
+++ b/libsoup/src/cookie-jar-text.hg
@@ -0,0 +1,47 @@
+/* Copyright (c) 2009 Siavash Safi <siavashs siavashs org>
+ *
+ * This file is part of libsoupmm.
+ *
+ * libsoupmm is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 2.1 of the License,
+ * or (at your option) any later version.
+ *
+ * libsoupmm is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * 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 program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/object.h>
+#include <libsoupmm/cookie-jar.h>
+#include <libsoup/soup-cookie-jar-text.h>
+
+_DEFS(libsoupmm,libsoup)
+//_PINCLUDE(glibmm/private/object_p.h)
+_PINCLUDE(libsoupmm/private/cookie-jar_p.h)
+
+namespace Soup
+{
+
+/** %Cookie text file handling.
+ * Soup::CookieJarText is a Soup::CookieJar that reads cookies from and writes them to a text file in the Mozilla "cookies.txt" format.
+ */
+class CookieJarText : public CookieJar
+{
+ _CLASS_GOBJECT(CookieJarText, SoupCookieJarText, SOUP_COOKIE_JAR_TEXT, CookieJar, SoupCookieJar)
+ _STRUCT_NOT_HIDDEN
+
+protected:
+ _WRAP_CTOR(CookieJarText(const std::string& filename, bool read_only), soup_cookie_jar_text_new)
+
+public:
+ _WRAP_CREATE(const std::string& filename, bool read_only=true)
+
+ _WRAP_PROPERTY("filename", std::string)
+};
+
+} // namespace Soup
diff --git a/libsoup/src/filelist.am b/libsoup/src/filelist.am
index 2d81237..a8af245 100644
--- a/libsoup/src/filelist.am
+++ b/libsoup/src/filelist.am
@@ -9,5 +9,5 @@ files_defs = \
libsoup_docs.xml \
libsoup_docs_override.xml
-files_hg = address.hg auth.hg cookie.hg cookie-jar.hg enums.hg message.hg message-body.hg server.hg session.hg uri.hg
+files_hg = address.hg auth.hg cookie.hg cookie-jar.hg cookie-jar-text.hg enums.hg message.hg message-body.hg server.hg session.hg uri.hg
files_ccg = $(files_hg:.hg=.ccg)
diff --git a/libsoup/src/libsoup_signals.defs b/libsoup/src/libsoup_signals.defs
index 7f7d7f0..a0d056c 100644
--- a/libsoup/src/libsoup_signals.defs
+++ b/libsoup/src/libsoup_signals.defs
@@ -113,6 +113,26 @@
(construct-only #t)
)
+;; From SoupCookieJarText
+
+(define-property read-only
+ (of-object "SoupCookieJarText")
+ (prop-type "GParamBoolean")
+ (docs "Whether or not the cookie jar is read-only")
+ (readable #t)
+ (writable #t)
+ (construct-only #t)
+)
+
+(define-property filename
+ (of-object "SoupCookieJarText")
+ (prop-type "GParamString")
+ (docs "Cookie-storage filename")
+ (readable #t)
+ (writable #t)
+ (construct-only #t)
+)
+
;; From SoupMessage
(define-signal wrote-informational
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]