From 528f4abec1f300f5113e94b96df695eeeb525937 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Mon, 21 Feb 2011 21:18:28 +0200 Subject: [PATCH] Apply astyle --- Link.cxx | 36 ++++++++++++--------- Quvi.h | 108 ++++++++++++++++++++++++++++++++------------------------------ Video.cxx | 44 ++++++++++++++----------- 3 files changed, 102 insertions(+), 86 deletions(-) diff --git a/Link.cxx b/Link.cxx index 452addc..64da41d 100644 --- a/Link.cxx +++ b/Link.cxx @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2010 Toni Gundogdu. * * This program is free software: you can redistribute it and/or modify @@ -21,31 +21,37 @@ Link::Link () :length_bytes (-1) { } -Link::Link (quvi_video_t qv) :length_bytes (-1) { +Link::Link (quvi_video_t qv) :length_bytes (-1) +{ #define _wrap(id,dst,type) \ do { type t; quvi_getprop(qv,id,&t); dst=t; } while (0) - _wrap(QUVIPROP_VIDEOURL, url, char*); - _wrap(QUVIPROP_VIDEOFILECONTENTTYPE, content_type, char*); - _wrap(QUVIPROP_VIDEOFILESUFFIX, file_suffix, char*); - _wrap(QUVIPROP_VIDEOFILELENGTH, length_bytes, double); + _wrap(QUVIPROP_VIDEOURL, url, char*); + _wrap(QUVIPROP_VIDEOFILECONTENTTYPE, content_type, char*); + _wrap(QUVIPROP_VIDEOFILESUFFIX, file_suffix, char*); + _wrap(QUVIPROP_VIDEOFILELENGTH, length_bytes, double); #undef _wrap } -Link::Link (const Link& l) :length_bytes (-1) { _swap (l); } +Link::Link (const Link& l) :length_bytes (-1) +{ + _swap (l); +} -Link& Link::operator=(const Link& l) { - if (this != &l) _swap (l); - return *this; +Link& Link::operator=(const Link& l) +{ + if (this != &l) _swap (l); + return *this; } Link::~Link () { } void -Link::_swap (const Link& l) { - content_type = l.content_type; - file_suffix = l.file_suffix; - url = l.url; - length_bytes = l.length_bytes; +Link::_swap (const Link& l) +{ + content_type = l.content_type; + file_suffix = l.file_suffix; + url = l.url; + length_bytes = l.length_bytes; } diff --git a/Quvi.h b/Quvi.h index cbace2f..30c4194 100644 --- a/Quvi.h +++ b/Quvi.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2010 Toni Gundogdu. * * This program is free software: you can redistribute it and/or modify @@ -25,77 +25,81 @@ class Query; class Video; class Link; -class Options { +class Options +{ public: - Options (); - Options (const Options&); - Options& operator=(const Options&); - virtual ~Options(); + Options (); + Options (const Options&); + Options& operator=(const Options&); + virtual ~Options(); private: - void _swap (const Options&); + void _swap (const Options&); public: - std::string user_agent; - std::string http_proxy; - bool verbose_libcurl; - std::string format; - bool verify; - bool shortened; - long category; + std::string user_agent; + std::string http_proxy; + bool verbose_libcurl; + std::string format; + bool verify; + bool shortened; + long category; }; -class Link { +class Link +{ public: - Link (); - Link (quvi_video_t); - Link (const Link&); - Link& operator=(const Link&); - virtual ~Link(); + Link (); + Link (quvi_video_t); + Link (const Link&); + Link& operator=(const Link&); + virtual ~Link(); private: - void _swap (const Link&); + void _swap (const Link&); public: - std::string content_type; - std::string file_suffix; - double length_bytes; - std::string url; + std::string content_type; + std::string file_suffix; + double length_bytes; + std::string url; }; -class Video { +class Video +{ public: - Video (); - Video (quvi_video_t); - Video (const Video&); - Video& operator=(const Video&); - virtual ~Video(); + Video (); + Video (quvi_video_t); + Video (const Video&); + Video& operator=(const Video&); + virtual ~Video(); private: - void _swap (const Video&); + void _swap (const Video&); public: - std::string title; - std::string host; - std::string url; - std::string id; - Link link; - bool ok; + std::string title; + std::string host; + std::string url; + std::string id; + Link link; + bool ok; }; -class Query { +class Query +{ public: - Query (); - Query (const Query&); - Query& operator=(const Query&); - virtual ~Query(); + Query (); + Query (const Query&); + Query& operator=(const Query&); + virtual ~Query(); public: - Video parse (const std::string&, const Options&); - int next_website (std::string&, std::string&); + Video parse (const std::string&, const Options&); + int next_website (std::string&, std::string&); private: - void _init (); - void _close (); + void _init (); + void _close (); private: - quvi_t _quvi; - void *_curl; + quvi_t _quvi; + void *_curl; public: - std::string last_error; - long quvi_code; - long resp_code; + std::string last_error; + long quvi_code; + long resp_code; }; #endif diff --git a/Video.cxx b/Video.cxx index e92c914..c1b38bf 100644 --- a/Video.cxx +++ b/Video.cxx @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2010 Toni Gundogdu. * * This program is free software: you can redistribute it and/or modify @@ -21,36 +21,42 @@ Video::Video () :ok (false) { } -Video::Video (quvi_video_t qv) :ok (true) { +Video::Video (quvi_video_t qv) :ok (true) +{ #define _wrap(id,dst,type) \ do { type t; quvi_getprop(qv,id,&t); dst=t; } while (0) - _wrap(QUVIPROP_HOSTID, host, char*); - _wrap(QUVIPROP_PAGEURL, url, char*); - _wrap(QUVIPROP_PAGETITLE, title, char*); - _wrap(QUVIPROP_VIDEOID, id, char*); + _wrap(QUVIPROP_HOSTID, host, char*); + _wrap(QUVIPROP_PAGEURL, url, char*); + _wrap(QUVIPROP_PAGETITLE, title, char*); + _wrap(QUVIPROP_VIDEOID, id, char*); #undef _wrap - link = Link (qv); - quvi_parse_close (&qv); + link = Link (qv); + quvi_parse_close (&qv); } -Video::Video (const Video& v) :ok (false) { _swap (v); } +Video::Video (const Video& v) :ok (false) +{ + _swap (v); +} Video& -Video::operator=(const Video& v) { - if (this != &v) _swap (v); - return *this; +Video::operator=(const Video& v) +{ + if (this != &v) _swap (v); + return *this; } Video::~Video () { } void -Video::_swap (const Video& v) { - title = v.title; - host = v.host; - url = v.url; - id = v.id; - link = v.link; - ok = v.ok; +Video::_swap (const Video& v) +{ + title = v.title; + host = v.host; + url = v.url; + id = v.id; + link = v.link; + ok = v.ok; } -- 2.11.4.GIT