feisty meow concerns codebase  2.140
common_outcomes.cpp
Go to the documentation of this file.
1 /*****************************************************************************\
2 * *
3 * Name : common_outcomes *
4 * Author : Chris Koeritz *
5 * *
6 *******************************************************************************
7 * Copyright (c) 1991-$now By Author. This program is free software; you can *
8 * redistribute it and/or modify it under the terms of the GNU General Public *
9 * License as published by the Free Software Foundation; either version 2 of *
10 * the License or (at your option) any later version. This is online at: *
11 * http://www.fsf.org/copyleft/gpl.html *
12 * Please send any updates to: fred@gruntose.com *
13 \*****************************************************************************/
14 
15 #include "common_outcomes.h"
16 
17 namespace basis {
18 
19 const char *common::outcome_name(const outcome &to_name)
20 {
21  switch (to_name.value()) {
22  case OKAY: return "OKAY";
23  case NOT_IMPLEMENTED: return "NOT_IMPLEMENTED";
24  case OUT_OF_RANGE: return "OUT_OF_RANGE";
25  case NOT_FOUND: return "NOT_FOUND";
26  case BAD_INPUT: return "BAD_INPUT";
27  case BAD_TYPE: return "BAD_TYPE";
28  case IS_FULL: return "IS_FULL";
29  case IS_EMPTY: return "IS_EMPTY";
30  case IS_NEW: return "IS_NEW";
31  case EXISTING: return "EXISTING";
32  case FAILURE: return "FAILURE";
33  case OUT_OF_MEMORY: return "OUT_OF_MEMORY";
34  case ACCESS_DENIED: return "ACCESS_DENIED";
35  case IN_USE: return "IN_USE";
36  case UNINITIALIZED: return "UNINITIALIZED";
37  case TIMED_OUT: return "TIMED_OUT";
38  case GARBAGE: return "GARBAGE";
39  case NO_SPACE: return "NO_SPACE";
40  case DISALLOWED: return "DISALLOWED";
41  case INCOMPLETE: return "INCOMPLETE";
42  case NO_HANDLER: return "NO_HANDLER";
43  case NONE_READY: return "NONE_READY";
44  case INVALID: return "INVALID";
45  case PARTIAL: return "PARTIAL";
46  case NO_LICENSE: return "NO_LICENSE";
47  case UNEXPECTED: return "UNEXPECTED";
48  case ENCRYPTION_MISMATCH: return "ENCRYPTION_MISMATCH";
49  default: return "UNKNOWN_OUTCOME";
50  }
51 }
52 
53 } // namespace.
54 
static const char * outcome_name(const outcome &to_name)
Returns a string representation of the outcome "to_name".
Outcomes describe the state of completion for an operation.
Definition: outcome.h:31
int value() const
Definition: outcome.h:51
The guards collection helps in testing preconditions and reporting errors.
Definition: array.h:30