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

📄 paco.cc

📁 About: Paco (pacKAGE oRGANIZER) is a simple, yet powerful tool to aid package management when insta
💻 CC
字号:
//=======================================================================// paco.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 "paco.h"#include <sstream>#include <iomanip>#include <fnmatch.h>using std::string;using namespace Paco;//// Check whether @path matches any path in the colon-separated @list of paths.// Shell-like wildcards in @list are expanded.//bool Paco::inPaths(string const& path, string const& list){   	std::istringstream s(list + ":");	string buf;	while (getline(s, buf, ':') && buf.size()) {		if (buf == "/" || !fnmatch(buf.c_str(), path.c_str(), 0) || !path.find(buf + "/"))			return true;	}	return false;}string Paco::sizeStr(int unit, float size){	if (size < 0)		return "@";	std::ostringstream s;		if (unit <= 0) { 	// HUMAN_READABLE		if (size < KILOBYTE)			s << static_cast<int>(size);		else if (size < MEGABYTE)			s << static_cast<long>(size) / KILOBYTE << "k";		else if (size < (10 * MEGABYTE))			s << std::setprecision(2) << size / MEGABYTE << "M";		else			s << static_cast<long>(size / MEGABYTE) << "M";	}	else		s << static_cast<long>(size / unit);			return s.str();}string Paco::sizeStr(int unit, long size){	return sizeStr(unit, static_cast<float>(size));}X::X(string const& msg):	std::runtime_error(msg){ }XErrno::XErrno(string const& msg):	std::runtime_error(msg + ": " + strerror(errno)){ }

⌨️ 快捷键说明

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