WvStreams
wvassert.cc
1/*
2 * Worldvisions Weaver Software:
3 * Copyright (C) 2005 Net Integration Technologies, Inc.
4 *
5 * Helper classes and functions to add more information to WvCrashes.
6 */
7
8#include "wvassert.h"
9
10WvCrashWill::WvCrashWill(const char *will)
11 : old_will(wvcrash_read_will())
12{
13 wvcrash_leave_will(will);
14}
15
16WvCrashWill::WvCrashWill(WVSTRING_FORMAT_DEFN)
17 : old_will(wvcrash_read_will())
18{
19 // We use a WvFastString here, because it is a temporary. init()
20 // will duplicate the string into a local buffer, so don't you
21 // worry.
22 wvcrash_leave_will(WvFastString(WVSTRING_FORMAT_CALL));
23}
24
25void WvCrashWill::rewrite(const char *will)
26{
27 // Don't touch old_will.
28 wvcrash_leave_will(will);
29}
30
31void WvCrashWill::rewrite(WVSTRING_FORMAT_DEFN)
32{
33 // Again, since wvcrash_leave_will will duplicate the string, we
34 // can use a WvFastString.
35 rewrite(WvFastString(WVSTRING_FORMAT_CALL));
36}
37
38WvCrashWill::~WvCrashWill()
39{
40 // Put the old will back.
41 wvcrash_leave_will(old_will);
42}
43
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Definition: wvstring.h:94