#include <ucommon/secure.h>
#include <sys/stat.h>
Go to the source code of this file.
|
static void | result (const char *path, int code) |
|
static void | digest (const char *path=NULL) |
|
static void | scan (String path, bool top=true) |
|
int | main (int argc, char **argv) |
|
|
static shell::flagopt | helpflag ('h',"--help", _TEXT("display this list")) |
|
static shell::flagopt | althelp ('?', NULL, NULL) |
|
static shell::stringopt | hash ('d', "--digest", _TEXT("digest method (md5)"), "method", "md5") |
|
static shell::flagopt | recursive ('R', "--recursive", _TEXT("recursive directory scan")) |
|
static shell::flagopt | altrecursive ('r', NULL, NULL) |
|
static shell::flagopt | hidden ('s', "--hidden", _TEXT("show hidden files")) |
|
static int | exit_code = 0 |
|
static const char * | argv0 = "md" |
|
static digest_t | md |
|
◆ digest()
static void digest |
( |
const char * |
path = NULL | ) |
|
|
static |
Definition at line 97 of file mdsum.cpp.
References ucommon::fsys::assign(), buffer, ucommon::fsys::close(), ucommon::fsys::err(), ucommon::fsys::info(), ucommon::shell::input(), ucommon::is(), ucommon::fsys::is_sys(), md, ucommon::fsys::open(), ucommon::Digest::put(), ucommon::fsys::read(), ucommon::Digest::reset(), result(), and ucommon::fsys::STREAM.
Referenced by ucommon::HMAC::HMAC(), ucommon::Cipher::Key::Key(), main(), ucommon::Digest::md5(), MD5Final(), scan(), ucommon::Cipher::Key::set(), ucommon::HMAC::set(), ucommon::Digest::sha1(), SHA1Final(), ucommon::Digest::sha256(), and ucommon::Digest::sha384().
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 163 of file mdsum.cpp.
References ucommon::_TEXT(), althelp, ucommon::shell::argv0(), argv0, ucommon::shell::bind(), digest(), ucommon::shell::errexit(), exit_code, ucommon::Digest::has(), hash, ucommon::shell::help(), helpflag, ucommon::secure::init(), ucommon::is(), ucommon::fsys::is_dir(), md, scan(), and ucommon::str().
◆ result()
static void result |
( |
const char * |
path, |
|
|
int |
code |
|
) |
| |
|
static |
Definition at line 35 of file mdsum.cpp.
References ucommon::_TEXT(), argv0, ucommon::shell::errexit(), exit_code, md, and ucommon::shell::printf().
Referenced by ucommon::mapref< K, V >::at(), ucommon::byteref< R >::b64(), ucommon::fsys::copy(), ucommon::ArrayRef::count(), digest(), ost::SysTime::getGMTTime(), ost::SysTime::getLocalTime(), ost::SysTime::gmtime(), ucommon::byteref< R >::hex(), ost::Process::join(), ost::SysTime::locatime(), ucommon::RecursiveMutex::lock(), ucommon::sstream::open(), ucommon::Date::operator+(), ucommon::Time::operator+(), ucommon::DateTime::operator+(), ucommon::Barrier::operator++(), ucommon::Date::operator-(), ucommon::Time::operator-(), ucommon::DateTime::operator-(), ucommon::Barrier::operator--(), ost::Serial::operator=(), ucommon::shell::path(), ucommon::shell::printf(), ucommon::stringref< R >::promote(), ucommon::byteref< R >::promote(), ucommon::ObjectPager::pull(), ucommon::StringPager::pull(), ucommon::Socket::query(), ucommon::temporary< uint8_t * >::read(), ucommon::Socket::readfrom(), ucommon::Socket::readline(), ucommon::ArrayRef::Array::remove(), ucommon::String::replace(), ucommon::utf8::rfind(), scan(), ucommon::String::search(), ucommon::sstream::sstream(), ucommon::JoinableThread::start(), ost::Thread::start(), ucommon::mapref< K, V >::take(), ucommon::String::token(), ucommon::StringPager::token(), ucommon::Barrier::wait(), ucommon::Semaphore::wait(), ucommon::TimedEvent::wait(), ost::Conditional::wait(), ucommon::temporary< uint8_t * >::write(), and ucommon::Socket::writeto().
◆ scan()
static void scan |
( |
String |
path, |
|
|
bool |
top = true |
|
) |
| |
|
static |
Definition at line 138 of file mdsum.cpp.
References altrecursive, digest(), hidden, ucommon::is(), ucommon::fsys::is_dir(), ucommon::dir::read(), recursive, result(), scan(), and ucommon::str().
Referenced by main(), and scan().
◆ althelp
◆ altrecursive
◆ argv0
◆ exit_code
◆ hash
shell::stringopt hash( 'd', "--digest", _TEXT("digest method (md5)"), "method", "md5") |
( |
'd' |
, |
|
|
"--digest" |
, |
|
|
_TEXT("digest method (md5)") |
, |
|
|
"method" |
, |
|
|
"md5" |
|
|
) |
| |
|
static |
◆ helpflag
shell::flagopt helpflag( 'h',"--help", _TEXT("display this list")) |
( |
'h' |
, |
|
|
"--help" |
, |
|
|
_TEXT("display this list") |
|
|
) |
| |
|
static |
◆ hidden
shell::flagopt hidden( 's', "--hidden", _TEXT("show hidden files")) |
( |
's' |
, |
|
|
"--hidden" |
, |
|
|
_TEXT("show hidden files") |
|
|
) |
| |
|
static |
◆ md
◆ recursive