removed the dependency on the compiled boost.date_time library
This commit is contained in:
1
Jamfile
1
Jamfile
@@ -133,7 +133,6 @@ project torrent
|
||||
<define>$(DEFINES)
|
||||
<library>/boost/thread//boost_thread #/<link>static
|
||||
<library>/boost/filesystem//boost_filesystem #/<link>static
|
||||
<library>/boost/date_time//boost_date_time #/<link>static
|
||||
<threading>multi
|
||||
|
||||
# ======= compiler settings =======
|
||||
|
@@ -1117,7 +1117,8 @@ void print(std::ostream& os) const;
|
||||
</pre>
|
||||
</blockquote>
|
||||
<p>The <tt class="docutils literal"><span class="pre">print()</span></tt> function is there for debug purposes only. It will print the info from
|
||||
the torrent file to the given outstream.</p>
|
||||
the torrent file to the given outstream. This function has been deprecated and will
|
||||
be removed from future releases.</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="trackers" name="trackers">trackers()</a></h2>
|
||||
|
@@ -1045,7 +1045,8 @@ print()
|
||||
void print(std::ostream& os) const;
|
||||
|
||||
The ``print()`` function is there for debug purposes only. It will print the info from
|
||||
the torrent file to the given outstream.
|
||||
the torrent file to the given outstream. This function has been deprecated and will
|
||||
be removed from future releases.
|
||||
|
||||
|
||||
trackers()
|
||||
|
@@ -147,8 +147,6 @@ void clear_home()
|
||||
|
||||
#endif
|
||||
|
||||
namespace pt = boost::posix_time;
|
||||
|
||||
std::string esc(char const* code)
|
||||
{
|
||||
#ifdef ANSI_TERMINAL_COLORS
|
||||
@@ -577,7 +575,7 @@ int main(int ac, char* av[])
|
||||
|
||||
std::deque<std::string> events;
|
||||
|
||||
boost::posix_time::ptime next_dir_scan = boost::posix_time::second_clock::universal_time();
|
||||
ptime next_dir_scan = time_now();
|
||||
|
||||
// the string is the filename of the .torrent file, but only if
|
||||
// it was added through the directory monitor. It is used to
|
||||
@@ -775,7 +773,7 @@ int main(int ac, char* av[])
|
||||
// loop through the alert queue to see if anything has happened.
|
||||
std::auto_ptr<alert> a;
|
||||
a = ses.pop_alert();
|
||||
std::string now = to_simple_string(boost::posix_time::second_clock::local_time());
|
||||
std::string now = time_now_string();
|
||||
while (a.get())
|
||||
{
|
||||
std::stringstream event_string;
|
||||
@@ -916,7 +914,7 @@ int main(int ac, char* av[])
|
||||
{
|
||||
boost::posix_time::time_duration t = s.next_announce;
|
||||
out << " next announce: " << esc("37") <<
|
||||
boost::posix_time::to_simple_string(t) << esc("0") << " ";
|
||||
t.hours() << ":" << t.minutes() << ":" << t.seconds() << esc("0") << " ";
|
||||
out << "tracker: " << s.current_tracker << "\n";
|
||||
}
|
||||
|
||||
@@ -997,12 +995,11 @@ int main(int ac, char* av[])
|
||||
puts(out.str().c_str());
|
||||
|
||||
if (!monitor_dir.empty()
|
||||
&& next_dir_scan < boost::posix_time::second_clock::universal_time())
|
||||
&& next_dir_scan < time_now())
|
||||
{
|
||||
scan_dir(monitor_dir, ses, handles, preferred_ratio
|
||||
, compact_allocation_mode, save_path);
|
||||
next_dir_scan = boost::posix_time::second_clock::universal_time()
|
||||
+ boost::posix_time::seconds(poll_interval);
|
||||
next_dir_scan = time_now() + seconds(poll_interval);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -45,6 +45,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
|
@@ -50,7 +50,7 @@ namespace libtorrent
|
||||
|
||||
#if (!defined (__MACH__) && !defined (_WIN32) && !defined(_POSIX_MONOTONIC_CLOCK) || _POSIX_MONOTONIC_CLOCK < 0) || defined (TORRENT_USE_BOOST_DATE_TIME)
|
||||
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
||||
|
||||
namespace libtorrent
|
||||
{
|
||||
|
@@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#pragma warning(push, 1)
|
||||
#endif
|
||||
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
|
@@ -138,7 +138,11 @@ namespace libtorrent
|
||||
int num_pieces() const { assert(m_piece_length > 0); return (int)m_piece_hash.size(); }
|
||||
const sha1_hash& info_hash() const { return m_info_hash; }
|
||||
const std::string& name() const { assert(m_piece_length > 0); return m_name; }
|
||||
|
||||
// ------- start deprecation -------
|
||||
void print(std::ostream& os) const;
|
||||
// ------- end deprecation -------
|
||||
|
||||
bool is_valid() const { return m_piece_length > 0; }
|
||||
|
||||
bool priv() const { return m_private; }
|
||||
|
@@ -33,7 +33,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "libtorrent/http_connection.hpp"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <asio/ip/tcp.hpp>
|
||||
#include <string>
|
||||
|
||||
using boost::bind;
|
||||
|
||||
|
@@ -736,6 +736,8 @@ namespace libtorrent
|
||||
assert(false);
|
||||
}
|
||||
|
||||
// ------- start deprecation -------
|
||||
|
||||
void torrent_info::print(std::ostream& os) const
|
||||
{
|
||||
os << "trackers:\n";
|
||||
@@ -746,8 +748,8 @@ namespace libtorrent
|
||||
}
|
||||
if (!m_comment.empty())
|
||||
os << "comment: " << m_comment << "\n";
|
||||
if (m_creation_date != pt::ptime(gr::date(pt::not_a_date_time)))
|
||||
os << "creation date: " << to_simple_string(m_creation_date) << "\n";
|
||||
// if (m_creation_date != pt::ptime(gr::date(pt::not_a_date_time)))
|
||||
// os << "creation date: " << to_simple_string(m_creation_date) << "\n";
|
||||
os << "private: " << (m_private?"yes":"no") << "\n";
|
||||
os << "number of pieces: " << num_pieces() << "\n";
|
||||
os << "piece length: " << piece_length() << "\n";
|
||||
@@ -756,6 +758,8 @@ namespace libtorrent
|
||||
os << " " << std::setw(11) << i->size << " " << i->path.string() << "\n";
|
||||
}
|
||||
|
||||
// ------- end deprecation -------
|
||||
|
||||
size_type torrent_info::piece_size(int index) const
|
||||
{
|
||||
assert(index >= 0 && index < num_pieces());
|
||||
|
Reference in New Issue
Block a user