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 
10 WvCrashWill::WvCrashWill(const char *will)
11  : old_will(wvcrash_read_will())
12 {
13  wvcrash_leave_will(will);
14 }
15 
16 WvCrashWill::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 
25 void WvCrashWill::rewrite(const char *will)
26 {
27  // Don't touch old_will.
28  wvcrash_leave_will(will);
29 }
30 
31 void 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 
38 WvCrashWill::~WvCrashWill()
39 {
40  // Put the old will back.
41  wvcrash_leave_will(old_will);
42 }
43 
WvFastString
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Definition: wvstring.h:93