⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pkgset.cc

📁 About: Paco (pacKAGE oRGANIZER) is a simple, yet powerful tool to aid package management when insta
💻 CC
字号:
//=======================================================================// PkgSet.cc//-----------------------------------------------------------------------// This file is part of the package paco// Copyright (C) 2004-2007 David Rosal <david.3r@gmail.com>// For more information visit http://paco.sourceforge.net//=======================================================================#include "config.h"#include "Config.h"#include "Pkg.h"#include "PkgSet.h"#include "util.h"using namespace Gpaco;PkgSet::PkgSet():	mSizeInst(0){	try {		Glib::Dir dir(Config::logdir());		for (Glib::Dir::iterator d = dir.begin(); d != dir.end(); ++d) {			try {				*this += new Pkg(*d);			}			catch (Paco::X& x) {				errorDialog(NULL, x.what(), true);			}			catch (...) { }		}	}	catch (Glib::Error& x) {		errorDialog(NULL, x.what(), true);	}}PkgSet::~PkgSet(){	for (iterator p = begin(); p != end(); ++p) {		g_assert(*p != NULL);		if (*p) {			delete *p;			*p = NULL;		}	}}bool PkgSet::hasPkg(std::string const& pkgName){	for (iterator p = begin(); p != end(); ++p) {		if ((*p)->name() == pkgName)			return true;	}	return false;}PkgSet& PkgSet::operator+=(Pkg* pkg){	g_assert(pkg != NULL);	push_back(pkg);	mSizeInst += pkg->sizeInst();	return *this;}PkgSet& PkgSet::operator-=(Pkg* pkg){	g_assert(pkg != NULL);	iterator i = std::remove(begin(), end(), pkg);	if (i != end()) {		mSizeInst -= pkg->sizeInst();		delete pkg;		pkg = NULL;		erase(i, end());	}	return *this;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -