Logo Search packages:      
Sourcecode: pan version File versions  Download package

pan::DataImpl Class Reference
[Backend Implementation]

#include <data-impl.h>

Inheritance diagram for pan::DataImpl:

pan::Data pan::TaskArchive pan::ProfilesImpl pan::ServerInfo pan::GroupServer pan::ArticleRead pan::Profiles pan::Profiles

List of all members.

Detailed Description

File-based implementation of the `Data' backend interface.

Most of the files are stored in $PAN_HOME, which defaults to $HOME/.pan2 if the PAN_HOME environmental variable isn't set.

Definition at line 56 of file data-impl.h.

Public Types

typedef std::vector< std::string > strings_t
typedef std::set< const Article * > unique_articles_t

Public Member Functions

virtual void add_groups (const Quark &server, const NewGroup *new_groups, size_t group_count)
void add_listener (Listener *l)
void add_listener (Listener *l)
virtual Quark add_new_server ()
virtual void add_profile (const std::string &profile_name, const Profile &profile)
virtual void add_profile (const std::string &profile_name, const Profile &profile)=0
virtual void add_score (const StringView &section_wildmat, int score_value, bool score_assign_flag, int lifespan_days, bool all_items_must_be_true, const Scorefile::AddItem *items, size_t item_count, bool do_rescore)
virtual void comment_out_scorefile_line (const StringView &filename, size_t begin_line, size_t end_line, bool do_rescore)
 DataImpl (bool unit_test=false, int cache_megs=10, DataIO *source=new DataIO())
virtual void delete_articles (const unique_articles_t &)=0
virtual void delete_articles (const unique_articles_t &)
virtual void delete_profile (const std::string &profile_name)
virtual void delete_profile (const std::string &profile_name)=0
virtual void delete_server (const Quark &server)
virtual const std::string & get_active_editor () const
virtual const std::string & get_active_editor () const =0
virtual void get_article_scores (const Quark &newsgroup, const Article &article, Scorefile::items_t &setme) const
virtual const ArticleCacheget_cache () const
virtual ArticleCacheget_cache ()
virtual void get_editors (strings_t &setme) const
virtual void get_editors (strings_t &setme) const =0
virtual void get_group_counts (const Quark &group, unsigned long &setme_unread, unsigned long &setme_total) const
virtual const std::string & get_group_description (const Quark &group) const
virtual char get_group_permission (const Quark &group) const
virtual void get_other_groups (std::vector< Quark > &) const
virtual bool get_profile (const std::string &profile_name, Profile &setme) const
virtual bool get_profile (const std::string &profile_name, Profile &setme) const =0
virtual std::set< std::string > get_profile_names () const
virtual std::set< std::string > get_profile_names () const =0
virtual bool get_server_addr (const Quark &server, std::string &setme_host, int &setme_port) const
virtual std::string get_server_address (const Quark &servername) const
virtual int get_server_article_expiration_age (const Quark &server) const
virtual bool get_server_auth (const Quark &server, std::string &setme_username, std::string &setme_password) const
virtual int get_server_limits (const Quark &server) const
virtual int get_server_rank (const Quark &server) const
virtual quarks_t get_servers () const
virtual void get_subscribed_groups (std::vector< Quark > &) const
virtual unsigned long get_xover_high (const Quark &group, const Quark &server) const
virtual void group_clear_articles (const Quark &group)
virtual ArticleTreegroup_get_articles (const Quark &group, const ShowType show_type=SHOW_ARTICLES, const FilterInfo *criteria=0) const
virtual void group_get_servers (const Quark &group, quarks_t &) const
virtual bool has_from_header (const StringView &from) const
virtual bool has_from_header (const StringView &from) const =0
virtual bool has_profiles () const
virtual bool has_profiles () const =0
virtual bool is_read (const Article *) const
virtual void load_tasks (std::vector< Task * > &setme)
virtual void mark_group_read (const Quark &group)
virtual void mark_read (const Article **articles, unsigned long article_count, bool mark_read=true)
virtual void mark_read (const Article &article, bool mark_read)
void remove_listener (Listener *l)
void remove_listener (Listener *l)
virtual void rescore ()
virtual void save_state ()
virtual void save_tasks (const std::vector< Task * > &saveme)
virtual void server_get_groups (const Quark &server, quarks_t &) const
virtual void set_active_editor (const StringView &)
virtual void set_active_editor (const StringView &)=0
virtual void set_editors (const strings_t &)
virtual void set_editors (const strings_t &)=0
virtual void set_group_subscribed (const Quark &group, bool sub)
virtual void set_server_addr (const Quark &server, const StringView &host, const int port)
virtual void set_server_article_expiration_age (const Quark &server, int days)
virtual void set_server_auth (const Quark &server, const StringView &username, const StringView &password)
virtual void set_server_limits (const Quark &server, int max_connections)
virtual void set_server_rank (const Quark &server, int rank)
virtual void set_xover_high (const Quark &group, const Quark &server, const unsigned long high)
virtual void set_xover_low (const Quark &group, const Quark &server, const unsigned long low)
virtual const Articlexover_add (const Quark &server, const Quark &group, const StringView &subject, const StringView &author, const StringView &date, const StringView &message_id, const StringView &references, const unsigned long byte_count, const unsigned long line_count, const StringView &xref)
virtual void xover_ref (const Quark &group)
virtual void xover_unref (const Quark &group)

Public Attributes

const ArticleFilter _article_filter

Protected Member Functions

void fire_group_counts (const Quark &, unsigned long unread, unsigned long total)
void fire_group_read (const Quark &)
void fire_group_subscribe (const Quark &, bool)
void fire_grouplist_rebuilt ()
void fire_server_limits_changed (const Quark &server, int max_connections)

Private Types

typedef sorted_vector< Quark,
typedef std::vector< const
ArticleNode * > 
typedef std::map< Quark,
std::string > 
typedef Loki::AssocVector
< Quark, GroupHeaders * > 
typedef sorted_vector< Quark,
true > 
typedef std::map< Quark,
ArticleNode * > 
typedef std::vector
< ArticleNode * > 
typedef Loki::AssocVector
< Quark, ReadGroup
typedef Loki::AssocVector
< Quark, Server > 
typedef sorted_vector< Quark,
true > 
typedef Loki::AssocVector
< Quark, XOverEntry

Private Member Functions

void add_articles_to_tree (MyTree *, const quarks_t &mids)
void ensure_descriptions_are_loaded () const
const ReadGroupfind_read_group (const Quark &g) const
ReadGroupfind_read_group (const Quark &g)
const ReadGroup::Serverfind_read_group_server (const Quark &g, const Quark &s) const
ReadGroup::Serverfind_read_group_server (const Quark &g, const Quark &s)
const Server * find_server (const Quark &server) const
Server * find_server (const Quark &server)
void free_group_headers_memory (const Quark &group)
virtual void get_article_references (const Quark &group, const Article *, std::string &setme) const
const GroupHeaders * get_group_headers (const Quark &group) const
GroupHeaders * get_group_headers (const Quark &group)
std::string get_newsrc_filename (const Quark &server) const
bool is_read (const Xref &) const
void load_article (const Quark &g, Article *article, const StringView &references)
void load_group_descriptions (const DataIO &) const
void load_group_permissions (const DataIO &)
void load_group_xovers (const DataIO &)
void load_headers (const DataIO &, const Quark &group)
void load_newsrc (const Quark &server, LineReader *, alpha_groups_t &, alpha_groups_t &)
void load_newsrc_files (const DataIO &)
void load_part (const Quark &g, const Quark &mid, size_t number, size_t lines, Article::Part &part)
void load_server_properties (const DataIO &)
void on_articles_added (const Quark &group, const quarks_t &mids)
void on_articles_changed (const quarks_t &mids, bool do_refilter) const
void on_articles_removed (const quarks_t &mids) const
void rebuild_backend ()
void ref_group (const Quark &group)
void remove_articles_from_tree (MyTree *, const quarks_t &mids) const
void save_group_descriptions (DataIO &) const
void save_group_permissions (DataIO &) const
void save_group_xovers (DataIO &) const
bool save_headers (DataIO &, const Quark &group, const std::vector< Article * > &, unsigned long &, unsigned long &) const
void save_headers (DataIO &, const Quark &group) const
void save_newsrc_files (DataIO &) const
void save_server_properties (DataIO &) const
void unref_group (const Quark &group)
void xover_clear_workarea (const Quark &group)
XOverEntryxover_get_workarea (const Quark &group)

Static Private Member Functions

static ArticleNodefind_ancestor (ArticleNode *node, const Quark &ancestor_mid)
static const ArticleNodefind_closest_ancestor (const ArticleNode *node, const unique_sorted_quarks_t &mid_pool)
static ArticleNodefind_closest_ancestor (ArticleNode *node, const unique_sorted_quarks_t &mid_pool)
static void find_nodes (const quarks_t &mids, const nodes_t &nodes, const_nodes_v &setme)
static void find_nodes (const quarks_t &mids, nodes_t &nodes, nodes_v &setme)

Private Attributes

ArticleCache _cache
Quark _cached_xover_group
descriptions_t _descriptions
bool _descriptions_loaded
group_to_headers_t _group_to_headers
groups_t _moderated
groups_t _nopost
read_groups_t _read_groups
Scorefile _scorefile
servers_t _servers
alpha_groups_t _subscribed
std::set< MyTree * > _trees
const bool _unit_test
alpha_groups_t _unsubscribed
xovers_t _xovers


struct  ArticleNode
struct  GroupHeaders
class  MyTree
struct  NodeWeakOrdering
struct  ReadGroup
struct  Server
struct  XOverEntry

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index