1 /*****************************************************************************\
3 * Name : process_entry *
4 * Author : Chris Koeritz *
6 *******************************************************************************
7 * Copyright (c) 2000-$now By Author. This program is free software; you can *
8 * redistribute it and/or modify it under the terms of the GNU General Public *
9 * License as published by the Free Software Foundation; either version 2 of *
10 * the License or (at your option) any later version. This is online at: *
11 * http://www.fsf.org/copyleft/gpl.html *
12 * Please send any updates to: fred@gruntose.com *
13 \*****************************************************************************/
15 #include "process_entry.h"
17 #include <basis/array.h>
18 #include <basis/astring.h>
19 #include <filesystem/filename.h>
21 using namespace basis;
22 using namespace filesystem;
26 process_entry::process_entry()
30 _parent_process_id(0),
32 _process_path(new astring)
35 process_entry::process_entry(const process_entry &to_copy)
39 _parent_process_id(0),
41 _process_path(new astring)
46 process_entry::~process_entry()
51 void process_entry::text_form(basis::base_string &fill) const
56 process_entry &process_entry::operator =(const process_entry &to_copy)
58 if (&to_copy == this) return *this;
59 _process_id = to_copy._process_id;
60 _references = to_copy._references;
61 _threads = to_copy._threads;
62 _parent_process_id = to_copy._parent_process_id;
63 *_process_path = *to_copy._process_path;
64 _module16 = to_copy._module16;
68 const astring &process_entry::path() const { return *_process_path; }
70 void process_entry::path(const astring &new_path)
71 { *_process_path = new_path; }
73 astring process_entry::text_form() const
78 filename pat(path().lower());
80 return a_sprintf("%s: pid=%u refs=%u thrd=%u par=%u mod16=%u path=%s",
81 pat.basename().raw().s(), _process_id, _references, _threads,
82 _parent_process_id, _module16, pat.dirname().raw().s());