Classes | |
struct | rutz::type_traits< nub::ref< T > > |
type_traits specialization for nub::ref smart pointer More... | |
struct | rutz::type_traits< nub::soft_ref< T > > |
type_traits specialization for soft_ref smart pointer. More... | |
class | out_of_range |
Exception class for range errors. More... | |
struct | static_block |
A simple wrapper around a C-style array. More... | |
class | fixed_block |
A dynamically-allocated array whose size is fixed at construction. More... | |
class | shared_array |
A reference-counted smart pointer for arrays. More... | |
class | dynamic_block |
A dynamically-allocated array whose size may be changed at runtime. More... | |
class | array_value |
A rutz::value subclass representing a variable-size set of homogeneous values. More... | |
class | assoc_array_base |
A non-typesafe wrapper around std::map<string, void*>. More... | |
class | assoc_array |
rutz::assoc_array is a typesafe wrapper of rutz::assoc_array_base. More... | |
class | darwin_atomic_int |
Atomic integer operations implemented using Apple Darwin's OSAtomicAdd32Barrier(). More... | |
struct | ix86_atomic_int_t |
class | ix86_atomic_int |
Atomic integer class for ix86 CPUs. More... | |
class | mutex_atomic_int |
Heavyweight atomic integer implementation using mutexes. More... | |
class | unsafe_atomic_int |
Thread-UNSAFE integer class. More... | |
class | backtrace |
Represents an instantaneous state of the call stack. More... | |
struct | byte_array |
class | circular_queue |
Circular fixed-size queue; T must have a default constructor. More... | |
class | imembuf |
An input streambuf that reads from memory. More... | |
class | imemstream |
An input stream class based on imembuf. More... | |
class | icstrstream |
An input stream class based on imembuf that makes a private copy. More... | |
class | error |
rutz::error is a basic exception class. More... | |
class | error_context |
Don't use this class directly; use the GVX_ERR_CONTEXT() macro instead. More... | |
class | error_context_entry |
Don't use this class directly; use the GVX_ERR_CONTEXT() macro instead. More... | |
class | creator_base |
Abstract interface for creating objects of a particular type. More... | |
class | creator_from_func |
Implements rutz::creator_base by calling a function pointer. More... | |
class | factory_fallback |
Abstract class for a fallback strategy when factory lookup fails. More... | |
class | factory_base |
Non-template helper class for rutz::factory. More... | |
class | factory |
Create objects base on 'key' strings. More... | |
struct | file_pos |
Represent a position (line number) within a source file. More... | |
class | free_list_base |
Un-typesafe base class for maintaining a free-list memory pool. More... | |
class | free_list |
Typesafe wrapper of free_list_base for maintaining free-list memory pools. More... | |
class | string_rep |
struct | char_range |
class | fstring |
struct | func_args |
Holds typedefs for the types of a function's arguments and return value. More... | |
struct | func_traits |
A traits class for holding information about functions/functors. More... | |
struct | rutz::func_traits< R(*)()> |
Specialization for free functions with no arguments. More... | |
struct | rutz::func_traits< R(*)(P1)> |
Specialization for free functions with 1 argument. More... | |
struct | rutz::func_traits< R(*)(P1, P2)> |
Specialization for free functions with 2 arguments. More... | |
struct | rutz::func_traits< R(*)(P1, P2, P3)> |
Specialization for free functions with 3 arguments. More... | |
struct | rutz::func_traits< R(*)(P1, P2, P3, P4)> |
Specialization for free functions with 4 arguments. More... | |
struct | rutz::func_traits< R(*)(P1, P2, P3, P4, P5)> |
Specialization for free functions with 5 arguments. More... | |
struct | rutz::func_traits< R(*)(P1, P2, P3, P4, P5, P6)> |
Specialization for free functions with 6 arguments. More... | |
struct | rutz::func_traits< R(C::*)()> |
Specialization for member functions with "this" plus 0 arguments. More... | |
struct | rutz::func_traits< R(C::*)() const > |
Specialization for member functions with "this" plus 0 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1)> |
Specialization for member functions with "this" plus 1 argument. More... | |
struct | rutz::func_traits< R(C::*)(P1) const > |
Specialization for member functions with "this" plus 1 argument. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2)> |
Specialization for member functions with "this" plus 2 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2) const > |
Specialization for member functions with "this" plus 2 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2, P3)> |
Specialization for member functions with "this" plus 3 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2, P3) const > |
Specialization for member functions with "this" plus 3 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2, P3, P4)> |
Specialization for member functions with "this" plus 4 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2, P3, P4) const > |
Specialization for member functions with "this" plus 4 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2, P3, P4, P5)> |
Specialization for member functions with "this" plus 5 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2, P3, P4, P5) const > |
Specialization for member functions with "this" plus 5 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2, P3, P4, P5, P6)> |
Specialization for member functions with "this" plus 6 arguments. More... | |
struct | rutz::func_traits< R(C::*)(P1, P2, P3, P4, P5, P6) const > |
Specialization for member functions with "this" plus 6 arguments. More... | |
struct | rutz::func_traits< mem_functor_base< MF > > |
func_traits specialization for mem_functor_base. More... | |
class | mem_functor_base |
mem_functor_base adapts a member function to an ordinary operator(). More... | |
struct | mem_functor |
mem_functor extends mem_functor_base smart pointers for "this". More... | |
struct | functor_of |
Traits struct for specifying a "functor" type given a function pointer. More... | |
struct | rutz::functor_of< R(C::*)() > |
Specialization for zero-arg mem func. More... | |
struct | rutz::functor_of< R(C::*)() const > |
Specialization for zero-arg const mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1) > |
Specialization for one-arg mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1) const > |
Specialization for one-arg const mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2) > |
Specialization for two-arg mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2) const > |
Specialization for two-arg const mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2, P3) > |
Specialization for three-arg mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2, P3) const > |
Specialization for three-arg const mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2, P3, P4) > |
Specialization for four-arg mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2, P3, P4) const > |
Specialization for four-arg const mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2, P3, P4, P5) > |
Specialization for 5-arg mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2, P3, P4, P5) const > |
Specialization for 5-arg const mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2, P3, P4, P5, P6) > |
Specialization for 6-arg mem func. More... | |
struct | rutz::functor_of< R(C::*)(P1, P2, P3, P4, P5, P6) const > |
Specialization for 6-arg const mem func. More... | |
struct | rutz::func_traits< bound_first< base_functor, bound_t > > |
func_traits specialization for bound_first. More... | |
class | bound_first |
bound_first wraps another functor type with a fixed first argument. More... | |
struct | rutz::func_traits< bound_last< base_functor, bound_t > > |
func_traits specialization for bound_last. More... | |
class | bound_last |
bound_last wraps another functor type with a fixed last argument. More... | |
class | gzstreambuf |
A std::streambuf implementation that handles gzip-encoded data. More... | |
class | filename_error |
An exception class for invalid filenames or inaccessible files. More... | |
struct | iter_end_t |
Symbol class for representing generic "end of iteration". More... | |
class | concrete_iter |
A template base class for all concrete iterator classes. More... | |
class | fwd_iter_ifx |
Abstract interface class for forward iterators. More... | |
class | fwd_iter_adapter |
Adapts forward iterators to the fwd_iter_ifx interface. More... | |
class | fwd_iter |
Concrete forward iterator class. More... | |
class | bidir_iter_ifx |
Abstract interface class for bidirectional iterators. More... | |
class | bidir_iter_adapter |
Adapts bidirectional iterators to the bidir_iter_ifx interface. More... | |
class | bidir_iter |
Concrete bidirectional iterator class. More... | |
class | rxs_iter_ifx |
Abstract interface class for random-access iterators. More... | |
class | rxs_iter_adapter |
Adapts random-access iterators to the rxs_iter_ifx interface. More... | |
class | rxs_iter |
Concrete random-access iterator class. More... | |
class | mapped_infile |
An mmap()/munmap() wrapper class for fast input file reading. More... | |
class | multi_value |
A rutz::value subclass representing a fixed-size set of homogeneous values. More... | |
class | mutex_lock_class |
Quick mutex locking class. More... | |
class | shell_pipe |
Adapts UNIX-style process pipes to a std::iostream interface. More... | |
class | pipe_fds |
An exception-safe wrapper around a pair of file descriptors from pipe(). More... | |
class | child_process |
An exception-safe wrapper around a child process from fork(). More... | |
class | exec_pipe |
An exception-safe wrapper around a pipe-fork-exec sequence. More... | |
class | bidir_pipe |
An exception-safe wrapper around a pipe-fork-exec sequence. More... | |
class | prof |
Accumulates profiling information for a given execution context. More... | |
class | urand |
Uniform random distribution. More... | |
class | urand_irange |
uniform distribution over a specified integer range More... | |
class | urand_frange |
uniform distribution over a specified floating-point range More... | |
class | scoped_ptr |
A smart-pointer for unshared objects. More... | |
class | serial_port |
rutz::serial_port provides character-at-a-time access to a serial port. More... | |
class | shared_ptr |
A thread-safe smart pointer with reference counted copy semantics. More... | |
class | spin_lock_locker |
class | spin_lock_darwin |
class | spin_lock_pthreads |
class | static_stack |
STL-style class for fixed-size stacks whose size is known at compile time. More... | |
class | stdiobuf |
A C++ streambuf that wraps a standard posix file descriptor. More... | |
class | stdiostream |
class | stopwatch |
Tracks elapsed wall-clock time. More... | |
class | time |
A simple wrapper around timeval. More... | |
class | trace |
Times and traces execution in and out of a lexical scope. More... | |
class | tracer |
A class for dynamic toggling sets of trace statements. More... | |
struct | type_traits |
Basic type traits class. More... | |
struct | rutz::type_traits< T * > |
Specialization of type traits for pointers. More... | |
struct | rutz::type_traits< T & > |
Specialization of type traits for references. More... | |
struct | rutz::type_traits< const T & > |
Specialization of type traits for const references. More... | |
struct | select_if |
Select between two types based on a compile-time constant boolean expression. More... | |
struct | rutz::select_if< false, if_true, if_false > |
Specialization of select_if for 'false'. More... | |
struct | type_match |
Helper class for is_sub_super. More... | |
struct | is_sub_super |
Determine whether sub derives from super. More... | |
struct | is_class |
Traits class to tell us whether T is a class type or not. More... | |
struct | is_polymorphic_imp1 |
Helper struct for telling whether T is a polymorphic type or not. More... | |
struct | is_polymorphic_imp2 |
struct | is_polymorphic_selector |
struct | rutz::is_polymorphic_selector< true > |
struct | is_polymorphic |
Traits class to tell whether T is a polymorphic type (i.e. has virtual functions). More... | |
struct | rutz::full_object_caster< T, false > |
struct | rutz::full_object_caster< T, true > |
class | value |
struct | rutz::func_traits< mem_functor< MF > > |
Specialization of func_traits for mem_functor. More... | |
struct | rutz::func_traits< tcl::func_wrapper< N, F, Func > > |
Specialization of func_traits for tcl::func_wrapper. More... | |
struct | rutz::type_traits< Cached< T > > |
Namespaces | |
namespace | unixcall |
Wrappers of OS/system calls. | |
Typedefs | |
typedef mutex_atomic_int | atomic_int_t |
Functions | |
template<class T> | |
const T & | min (const T &a, const T &b) |
template<class T> | |
const T & | max (const T &a, const T &b) |
template<class T> | |
T | abs (const T &val) |
template<class T> | |
T | clamp (const T &val, const T &lower, const T &upper) |
template<class T> | |
void | swap2 (T &t1, T &t2) |
template<class T, std::size_t N> | |
T * | array_begin (T(&array)[N]) |
Get a pointer to the beginning of a C-style array. | |
template<class T, std::size_t N> | |
T * | array_end (T(&array)[N]) |
Get a pointer to the one-past-the-end of a C-style array. | |
template<class T, std::size_t N> | |
const T * | array_begin (T const (&array)[N]) |
Get a pointer to the beginning of a C-style const array. | |
template<class T, std::size_t N> | |
const T * | array_end (T const (&array)[N]) |
Get a pointer to the one-past-the-end of a C-style const array. | |
template<typename T> | |
bool | operator== (const shared_array< T > &a, const shared_array< T > &b) |
Equality for shared_array; returns true if both have the same pointee. | |
template<typename T> | |
bool | operator!= (const shared_array< T > &a, const shared_array< T > &b) |
Inequality for shared_array; returns true if each has different pointees. | |
rutz::fstring | format (const rutz::backtrace &bt) |
Generate a human-readable string representation of the backtrace. | |
void | base64_encode (const unsigned char *src, unsigned int src_len, rutz::byte_array &dst, unsigned int line_width) |
void | base64_encode_string (const char *str, rutz::byte_array &dst, unsigned int line_width) |
void | base64_encode_file (const char *filename, rutz::byte_array &dst, unsigned int line_width) |
void | base64_decode (const char *src, unsigned int in_len, rutz::byte_array &dst) |
void | base64_decode (const rutz::byte_array &src, rutz::byte_array &dst) |
shared_ptr< std::ostream > | obzip2open (const fstring &filename, std::ios::openmode flags) |
shared_ptr< std::istream > | ibzip2open (const fstring &filename, std::ios::openmode flags) |
shared_ptr< std::ostream > | obzip2open (const char *filename, std::ios::openmode flags=std::ios::openmode(0)) |
Overload. | |
shared_ptr< std::istream > | ibzip2open (const char *filename, std::ios::openmode flags=std::ios::openmode(0)) |
Overload. | |
double | compat_m_pi () |
double | compat_m_pi_2 () |
double | compat_m_e () |
double | compat_m_ln2 () |
const char * | demangled_name (const std::type_info &info) |
Returns a demangled typename for the given type. | |
fstring | sconvert (char x) |
Convert char -> fstring. | |
fstring | sconvert (const char *x) |
Convert c string -> fstring. | |
fstring | sconvert (const fstring &x) |
Convert fstring -> fstring. | |
fstring | sconvert (bool x) |
Convert bool -> fstring. | |
fstring | sconvert (int x) |
Convert int -> fstring. | |
fstring | sconvert (unsigned int x) |
Convert uint -> fstring. | |
fstring | sconvert (long x) |
Convert long -> fstring. | |
fstring | sconvert (unsigned long x) |
Convert ulong -> fstring. | |
fstring | sconvert (double x) |
Convert double -> fstring. | |
bool | operator== (const char *lhs, const fstring &rhs) throw () |
bool | operator!= (const char *lhs, const fstring &rhs) throw () |
std::istream & | operator>> (std::istream &is, fstring &str) |
std::ostream & | operator<< (std::ostream &os, const fstring &str) |
std::istream & | getline (std::istream &is, fstring &str) |
std::istream & | getline (std::istream &is, fstring &str, char eol) |
template<class MF> | |
mem_functor< MF > | mem_func (MF mf) |
Factory function to make a mem_functor from any member function. | |
template<class fptr> | |
functor_of< fptr >::type | build_functor (fptr f) |
Factory function for building a "functor" from any function pointer. | |
template<class base_functor, class bound_t> | |
bound_first< base_functor, bound_t > | bind_first (base_functor base, bound_t bound) |
Factory function for creating bound_first functors. | |
template<class base_functor, class bound_t> | |
bound_last< base_functor, bound_t > | bind_last (base_functor base, bound_t bound) |
Factory function for creating bound_last functors. | |
shared_ptr< std::ostream > | ogzopen (const fstring &filename, std::ios::openmode flags) |
shared_ptr< std::ostream > | ogzopen (const char *filename, std::ios::openmode flags=std::ios::openmode(0)) |
Overload. | |
shared_ptr< std::istream > | igzopen (const char *filename, std::ios::openmode flags=std::ios::openmode(0)) |
Overload. | |
shared_ptr< std::istream > | igzopen (const fstring &filename, std::ios::openmode flags) |
template<class T> | |
T & | getref (T &t) |
template<class T1, class T2> | |
T2 & | getref (std::pair< T1, T2 > &p) |
template<class T> | |
T | rand_range (const T &min, const T &max) |
fstring | vsfmt (const char *fmt, va_list ap) |
snprintf() the specified format string + varargs into a rutz::fstring. | |
fstring | sfmt (const char *fmt,...)__attribute__((format(__printf__ |
snprintf() the specified format string + varargs into a rutz::fstring. | |
template<class T, class U> | |
bool | operator== (const shared_ptr< T > &a, const shared_ptr< U > &b) |
Test whether two shared_ptr's point to the same object. | |
template<class T, class U> | |
bool | operator!= (const shared_ptr< T > &a, const shared_ptr< U > &b) |
Test whether two shared_ptr's point to different objects. | |
template<class T> | |
shared_ptr< T > | make_shared (T *t) |
A convenience function for making a shared_ptr out of a raw pointer. | |
template<class Dst, class Src> | |
shared_ptr< Dst > | dyn_cast (const shared_ptr< Src > &src) |
Do a dynamic cast on a shared ptr. | |
template<class Dst, class Src> | |
void | dyn_cast_to_from (shared_ptr< Dst > &dst, const shared_ptr< Src > &src) |
Do a dynamic cast on a shared ptr. | |
template<class Dst, class Src> | |
shared_ptr< Dst > | dynCast (const shared_ptr< Src > &src) |
Synonym for dyn_cast. | |
template<class Dst, class Src> | |
void | dynCastToFrom (shared_ptr< Dst > &dst, const shared_ptr< Src > &src) |
Synonym for dyn_cast_to_from. | |
void | throw_bad_cast (const std::type_info &to, const std::type_info &from, const rutz::file_pos &pos) |
rutz::fstring | format_time (const timeval &tval, const char *formatstring="%a %b %d %H:%M:%S %Z %Y") |
Return a formatted string (a la strftime) for the given timeval. | |
template<class U> | |
traits::yes_type | is_class_tester (void(U::*)(void)) |
Remove const/volative qualifiers. | |
template<class T> | |
const void * | full_object_cast (const T *p) |
Cast a pointer to the beginning of the full object. | |
void | test_require (bool expr, const char *expr_string, const rutz::file_pos &pos) |
template<class T, class U> | |
void | test_require_eq (const T &expr1, const U &expr2, const char *expr_string1, const char *expr_string2, const rutz::file_pos &pos) |
bool | approx_eq (double a, double b, double tol=APPROX_TOL) |
void | test_require_approx_eq (double expr1, double expr2, double tol, const char *expr_string1, const char *expr_string2, const rutz::file_pos &pos) |
Variables | |
const iter_end_t | iter_end = {} |
unsigned long | default_rand_seed = 0 |
A hook that allows various code to start from a predictable seed. | |
traits::no_type | is_class_tester (...) |
const double | APPROX_TOL = 1e-40 |
rutz::fstring rutz::format | ( | const rutz::backtrace & | bt | ) |
Generate a human-readable string representation of the backtrace.
Note: this function is not part of rutz::backtrace's interface so that rutz::backtrace doesn't have to depend on rutz::fstring, in order to break cyclic dependencies. In any case, this function's implementation doesn't need access to rutz::backtrace's privates.
Definition at line 46 of file backtraceformat.cc.
References rutz::backtrace::size().
rutz::fstring rutz::format_time | ( | const timeval & | tval, | |
const char * | formatstring = "%a %b %d %H:%M:%S %Z %Y" | |||
) |
Return a formatted string (a la strftime) for the given timeval.
Formatting codes (see 'man strftime' for more details):
a The abbreviated weekday name according to the current locale.
A The full weekday name according to the current locale.
b The abbreviated month name according to the current locale.
B The full month name according to the current locale.
c The preferred date and time representation for the current locale.
C The century number (year/100) as a 2-digit integer. (SU)
d The day of the month as a decimal number (range 01 to 31).
D Equivalent to m/d/y. (Yecch - for Americans only. Americans should note that in other countries d/m/y is rather common. This means that in international context this format is ambiguous and should not be used.) (SU)
e Like d, the day of the month as a decimal number, but a leading zero is replaced by a space. (SU)
E Modifier: use alternative format, see below. (SU)
F Equivalent to Y-m-d (the ISO 8601 date format). (C99)
G The ISO 8601 year with century as a decimal number. The 4-digit year corresponding to the ISO week number (see V). This has the same format and value as y, except that if the ISO week number belongs to the previous or next year, that year is used instead. (TZ)
g Like G, but without century, i.e., with a 2-digit year (00-99). (TZ)
h Equivalent to b. (SU)
H The hour as a decimal number using a 24-hour clock (range 00 to 23).
I The hour as a decimal number using a 12-hour clock (range 01 to 12).
j The day of the year as a decimal number (range 001 to 366).
k The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also H.) (TZ)
l The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also I.) (TZ)
m The month as a decimal number (range 01 to 12).
M The minute as a decimal number (range 00 to 59).
n A newline character. (SU)
O Modifier: use alternative format, see below. (SU)
p Either `AM' or `PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as `pm' and midnight as `am'.
P Like p but in lowercase: `am' or `pm' or a corresponding string for the current locale. (GNU)
r The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to `I:M:S p'. (SU)
R The time in 24-hour notation (H:M). (SU) For a version including the seconds, see T below.
s The number of seconds since the Epoch, i.e., since 1970-01-01 00:00:00 UTC. (TZ)
S The second as a decimal number (range 00 to 61).
t A tab character. (SU)
T The time in 24-hour notation (H:M:S). (SU)
u The day of the week as a decimal, range 1 to 7, Monday being 1. See also w. (SU)
U The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also V and W.
V The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. See also U and W. (SU)
w The day of the week as a decimal, range 0 to 6, Sunday being 0. See also u.
W The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01.
x The preferred date representation for the current locale without the time.
X The preferred time representation for the current locale without the date.
y The year as a decimal number without a century (range 00 to 99).
Y The year as a decimal number including the century.
z The time-zone as hour offset from GMT. Required to emit RFC822-conformant dates (using "a, d b Y H:M:S z"). (GNU)
Z The time zone or name or abbreviation.
+ The date and time in date(1) format. (TZ)
%% A literal `' character.
Definition at line 40 of file timeformat.cc.
Referenced by ExptDriver::edBeginExpt(), and ExptDriver::storeData().
const void* rutz::full_object_cast | ( | const T * | p | ) | [inline] |
Cast a pointer to the beginning of the full object.
Here we select between static_cast and dynamic_cast depending on whether T is polymorphic.
Definition at line 215 of file traits.h.
Referenced by rutz::shared_ptr< T >::shared_ptr().
shared_ptr< std::istream > rutz::ibzip2open | ( | const rutz::fstring & | filename, | |
std::ios::openmode | flags = std::ios::openmode(0) | |||
) |
Opens a file for reading. An exception will be thrown if the specified file cannot be opened. The input file will be bzip2-decompressed if the filename ends with ".bz2".
Definition at line 81 of file bzip2stream.cc.
References rutz::fstring::c_str(), rutz::fstring::ends_with(), make_shared(), sfmt(), and SRC_POS.
Referenced by ibzip2open().
shared_ptr< std::istream > rutz::igzopen | ( | const rutz::fstring & | filename, | |
std::ios::openmode | flags = std::ios::openmode(0) | |||
) |
Opens a file for reading. An exception will be thrown if the specified file cannot be opened. If the file is gz-compressed, this will be automagically detected regardless of the filename extension.
Definition at line 260 of file gzstreambuf.cc.
References rutz::fstring::c_str(), and igzopen().
shared_ptr< std::ostream > rutz::obzip2open | ( | const rutz::fstring & | filename, | |
std::ios::openmode | flags = std::ios::openmode(0) | |||
) |
Opens a file for writing. An exception will be thrown if the specified file cannot be opened. The output file will be bzip2-compressed if the filename ends with ".bz2".
Definition at line 58 of file bzip2stream.cc.
References rutz::fstring::c_str(), rutz::fstring::ends_with(), make_shared(), sfmt(), and SRC_POS.
Referenced by obzip2open().
shared_ptr< std::ostream > rutz::ogzopen | ( | const rutz::fstring & | filename, | |
std::ios::openmode | flags = std::ios::openmode(0) | |||
) |
Opens a file for writing. An exception will be thrown if the specified file cannot be opened. The output file will be gz-compressed if the filename ends with ".gz".
Definition at line 224 of file gzstreambuf.cc.
References rutz::fstring::c_str(), rutz::fstring::ends_with(), make_shared(), sfmt(), and SRC_POS.
Referenced by ogzopen().
rutz::fstring rutz::vsfmt | ( | const char * | fmt, | |
va_list | ap | |||
) |
unsigned long rutz::default_rand_seed = 0 |
A hook that allows various code to start from a predictable seed.
This allows code in disparate locations to all be triggered by the same random seed. This is useful in allowing for predictable and repeatable execution sequences e.g. in a testing context. Initial value is 0. The most sensible use case involves setting this value just once, at or near the beginning of program execution.
Definition at line 38 of file rand.cc.
Referenced by geom::txform::random().