diff options
Diffstat (limited to 'libs/util/include')
-rw-r--r-- | libs/util/include/AbstractListAssembler.h | 12 | ||||
-rw-r--r-- | libs/util/include/JSonWriter.h | 12 | ||||
-rw-r--r-- | libs/util/include/ManagedMap.h | 12 | ||||
-rw-r--r-- | libs/util/include/Persistable.h | 35 | ||||
-rw-r--r-- | libs/util/include/Url.h | 67 |
5 files changed, 120 insertions, 18 deletions
diff --git a/libs/util/include/AbstractListAssembler.h b/libs/util/include/AbstractListAssembler.h index 9ce357b..d709249 100644 --- a/libs/util/include/AbstractListAssembler.h +++ b/libs/util/include/AbstractListAssembler.h @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: AbstractListAssembler.h * Created: 6. Juli 2012, 09 * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> * Project: libutil - base classes used by other libraries - * + * * CMP - compound media player - * + * * is a client/server mediaplayer intended to play any media from any workstation * without the need to export or mount shares. cmps is an easy to use backend * with a (ready to use) HTML-interface. Additionally the backend supports * authentication via HTTP-digest authorization. * cmpc is a client with vdr-like osd-menues. - * + * * Copyright (c) 2012 Reinhard Mantey, some rights reserved! * published under Creative Commons by-sa * For details see http://creativecommons.org/licenses/by-sa/3.0/ - * + * * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp - * + * * -------------------------------------------------------------- */ #ifndef ABSTRACTLISTASSEMBLER_H diff --git a/libs/util/include/JSonWriter.h b/libs/util/include/JSonWriter.h index 00fdfb3..8031565 100644 --- a/libs/util/include/JSonWriter.h +++ b/libs/util/include/JSonWriter.h @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: JSonWriter.h * Created: 6. Juli 2012, 12 * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> * Project: libutil - base classes used by other libraries - * + * * CMP - compound media player - * + * * is a client/server mediaplayer intended to play any media from any workstation * without the need to export or mount shares. cmps is an easy to use backend * with a (ready to use) HTML-interface. Additionally the backend supports * authentication via HTTP-digest authorization. * cmpc is a client with vdr-like osd-menues. - * + * * Copyright (c) 2012 Reinhard Mantey, some rights reserved! * published under Creative Commons by-sa * For details see http://creativecommons.org/licenses/by-sa/3.0/ - * + * * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp - * + * * -------------------------------------------------------------- */ #ifndef JSONWRITER_H diff --git a/libs/util/include/ManagedMap.h b/libs/util/include/ManagedMap.h index e1e6e2e..e8f04f7 100644 --- a/libs/util/include/ManagedMap.h +++ b/libs/util/include/ManagedMap.h @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: ManagedMap.h * Created: 7. Juli 2012, 08 * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> * Project: libutil - base classes used by other libraries - * + * * CMP - compound media player - * + * * is a client/server mediaplayer intended to play any media from any workstation * without the need to export or mount shares. cmps is an easy to use backend * with a (ready to use) HTML-interface. Additionally the backend supports * authentication via HTTP-digest authorization. * cmpc is a client with vdr-like osd-menues. - * + * * Copyright (c) 2012 Reinhard Mantey, some rights reserved! * published under Creative Commons by-sa * For details see http://creativecommons.org/licenses/by-sa/3.0/ - * + * * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp - * + * * -------------------------------------------------------------- */ #ifndef MANAGEDMAP_H diff --git a/libs/util/include/Persistable.h b/libs/util/include/Persistable.h new file mode 100644 index 0000000..aba962d --- /dev/null +++ b/libs/util/include/Persistable.h @@ -0,0 +1,35 @@ +/** + * ======================== legal notice ====================== + * + * File: Persistable.h + * Created: 29. Juli 2012, 13:08 + * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> + * Project: libutil - base classes used by other libraries + * + * CMP - compound media player + * + * is a client/server mediaplayer intended to play any media from any workstation + * without the need to export or mount shares. cmps is an easy to use backend + * with a (ready to use) HTML-interface. Additionally the backend supports + * authentication via HTTP-digest authorization. + * cmpc is a client with vdr-like osd-menues. + * + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! + * published under Creative Commons by-sa + * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * + * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * + * -------------------------------------------------------------- + */ +#ifndef PERSISTABLE_H +#define PERSISTABLE_H + +class cPersistable { +public: + virtual int Store(const char *FileName) = 0; + virtual int Load(const char *FileName) = 0; + }; + +#endif /* PERSISTABLE_H */ + diff --git a/libs/util/include/Url.h b/libs/util/include/Url.h new file mode 100644 index 0000000..e2cd1c3 --- /dev/null +++ b/libs/util/include/Url.h @@ -0,0 +1,67 @@ +/** + * ======================== legal notice ====================== + * + * File: Url.h + * Created: 4. Juli 2012, 05 + * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> + * Project: libutil - base classes used by other libraries + * + * CMP - compound media player + * + * is a client/server mediaplayer intended to play any media from any workstation + * without the need to export or mount shares. cmps is an easy to use backend + * with a (ready to use) HTML-interface. Additionally the backend supports + * authentication via HTTP-digest authorization. + * cmpc is a client with vdr-like osd-menues. + * + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! + * published under Creative Commons by-sa + * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * + * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * + * -------------------------------------------------------------- + */ +#ifndef URL_H +#define URL_H + +#include <stddef.h> +#include <string> +#include <tr1/unordered_map> +class cURLEncoder; +class cURLDecoder; + +class cUrl { +///< splits an url into machine readable parts: +///< from top-level sight, an url consists of url and querystring. Looking bit closer, +///< the url consists of toplevel and path, where as the querystring is a list of +///< name/value tuples with value being an optional part. +public: + cUrl(const char *RawURL); + virtual ~cUrl(); + const char *Parameter(const char *Name); + void SetParameter(const char* Name, const char* Value = NULL); + size_t EstimatedSize(void) const; ///< is a rough guess about the size of the final encoded url + void ParseURL(const char *URL); + char *ToString(void) const; ///< writes the url to a newly allocated buffer + int WriteBuf(char *buf, size_t bufSize) const; ///< writes the url to preexisting buffer + ///< returns the characters written. -1 as return value indicates a buffer overrun. + const char * Path() const { return path; } +#ifdef DEBUG + void Dump(void); +#endif + static void Cleanup(void); + static cURLEncoder *Encoder(void); + static cURLDecoder *Decoder(void); + +protected: + void ParseQueryString(const char *QueryString); + +private: + typedef std::tr1::unordered_map<std::string, std::string> ParameterMap; + char *path; + ParameterMap parameters; + }; + +#endif /* URL_H */ + |