Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11756 - in /trunk/libzypp/zypp: HistoryLog.cc HistoryLog.h
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Thu, 20 Nov 2008 19:14:54 -0000
  • Message-id: <20081120191454.A6D56E02C5@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Thu Nov 20 20:14:54 2008
New Revision: 11756

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11756&view=rev
Log:
doc

Modified:
trunk/libzypp/zypp/HistoryLog.cc
trunk/libzypp/zypp/HistoryLog.h

Modified: trunk/libzypp/zypp/HistoryLog.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/HistoryLog.cc?rev=11756&r1=11755&r2=11756&view=diff
==============================================================================
--- trunk/libzypp/zypp/HistoryLog.cc (original)
+++ trunk/libzypp/zypp/HistoryLog.cc Thu Nov 20 20:14:54 2008
@@ -38,7 +38,7 @@
{
static char buf[256];
string result;
- char * tmp = ::cuserid(buf);
+ char * tmp = ::cuserid(buf);
if (tmp)
{
result = string(tmp);
@@ -225,7 +225,7 @@
}

/////////////////////////////////////////////////////////////////////////
-
+
void HistoryLog::install( const PoolItem & pi )
{
const Package::constPtr p = asKind<Package>(pi.resolvable());
@@ -250,7 +250,7 @@
<< _sep << p->repoInfo().alias() // 7 repo alias
<< _sep << p->checksum().checksum(); // 8 checksum

- _log << endl;
+ _log << endl;

//_log << pi << endl;
}
@@ -279,7 +279,7 @@
// we don't have checksum in rpm db
// << _sep << p->checksum().checksum(); // x checksum

- _log << endl;
+ _log << endl;

//_log << pi << endl;
}
@@ -290,7 +290,7 @@
{
_log
<< timestamp() // 1 timestamp
- << _sep << HistoryActionID::REPO_ADD.asString(true) // 2 action
+ << _sep << HistoryActionID::REPO_ADD.asString(true) // 2 action
<< _sep << str::escape(repo.alias(), _sep) // 3 alias
// what about the rest of the URLs??
<< _sep << *repo.baseUrlsBegin() // 4 primary URL
@@ -302,7 +302,7 @@
{
_log
<< timestamp() // 1 timestamp
- << _sep << HistoryActionID::REPO_REMOVE.asString(true) // 2 action
+ << _sep << HistoryActionID::REPO_REMOVE.asString(true) // 2 action
<< _sep << str::escape(repo.alias(), _sep) // 3 alias
<< endl;
}
@@ -319,7 +319,7 @@
<< _sep << str::escape(oldrepo.alias(), _sep) // 3 old alias
<< _sep << str::escape(newrepo.alias(), _sep); // 4 new alias
}
-
+
if (*oldrepo.baseUrlsBegin() != *newrepo.baseUrlsBegin())
{
_log

Modified: trunk/libzypp/zypp/HistoryLog.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/HistoryLog.h?rev=11756&r1=11755&r2=11756&view=diff
==============================================================================
--- trunk/libzypp/zypp/HistoryLog.h (original)
+++ trunk/libzypp/zypp/HistoryLog.h Thu Nov 20 20:14:54 2008
@@ -20,14 +20,14 @@
{
class PoolItem;
class RepoInfo;
-
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : HistoryLog
//
/**
* Enumeration of known history actions.
- *
+ *
* \ingroup g_EnumerationClass
*/
struct HistoryActionID
@@ -61,10 +61,11 @@

ID toEnum() const { return _id; }

- HistoryActionID::ID parse(const std::string & strval_r);
+ static HistoryActionID::ID parse(const std::string & strval_r);

const std::string & asString(bool pad = false) const;

+ private:
ID _id;
};

@@ -95,14 +96,19 @@
* HistoryLog().comment(someMessage);
* }
* </code>
- *
+ *
* \note Take care to set proper target root dir if needed. Either pass
* it via the constructor, or set it via setRoot(Pathname) method.
* The default location of the file is determined by
* \ref ZConfig::historyLogPath() which defaults to
* /var/log/zypp/history.
- *
+ *
* \see http://en.opensuse.org/Libzypp/Package_History
+ *
+ * \todo Static private stuff does not need to be mentioned here in the
+ * header (use an annon. namespace in the .cc). Appart from that the
+ * implementation as signleton is questionable. Use shared_ptr instead of
+ * handcrafted ref/unref. Manage multiple logs at different locations.
*/
class HistoryLog
{
@@ -131,10 +137,10 @@

/**
* Set new root directory to the default history log file path.
- *
+ *
* This path will be prepended to the default log file path. This should
* be done where there is a potential that the target root has changed.
- *
+ *
* \param root new root directory.
*/
static void setRoot( const Pathname & root );
@@ -146,17 +152,17 @@

/**
* Log a comment (even multiline).
- *
+ *
* \param comment the comment
* \param timestamp whether to include a timestamp at the start of the
comment
*/
void comment( const std::string & comment, bool timestamp = false );
-
+
/**
* Log installation (or update) of a package.
*/
void install( const PoolItem & pi );
-
+
/**
* Log removal of a package
*/
@@ -164,24 +170,24 @@

/**
* Log a newly added repository.
- *
+ *
* \param repo info about the added repository
*/
void addRepository( const RepoInfo & repo );
-
+
/**
* Log recently removed repository.
- *
+ *
* \param repo info about the removed repository
*/
void removeRepository( const RepoInfo & repo );
-
+
/**
* Log certain modifications to a repository.
- *
+ *
* \param oldrepo info about the old repository
* \param newrepo info about the new repository
- */
+ */
void modifyRepository( const RepoInfo & oldrepo, const RepoInfo & newrepo
);
};
///////////////////////////////////////////////////////////////////

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages