FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
CConvMessage.cpp
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright (c) 2019 FrontISTR Commons
3 * This software is released under the MIT License, see LICENSE.txt
4 *****************************************************************************/
5/* CConvMessage class Ver.1.0 */
6
7#include "CConvMessage.h"
8
9const char ERROR_MSG[][80] = {"No error",
10 "Unknown error",
11 "Coordinate error",
12 "Not supported element",
13 "Invalid element property",
14 "Not supported property of element"};
15
16char CConvMessage::msg[256] = "";
17
18CConvMessage::CConvMessage(int No, const char *op_msg, ...) : no(No) {
19 if (op_msg[0] == 0) {
20 option_msg[0] = 0;
21 return;
22 }
23
24 va_list va;
25 va_start(va, op_msg);
26 vsprintf(option_msg, op_msg, va);
27 va_end(va);
28}
29
30const char *CConvMessage::Msg() {
31 if (option_msg[0] != 0) {
32 sprintf(msg, "##Error: %s : %s", ERROR_MSG[no], option_msg);
33
34 } else {
35 sprintf(msg, "##Error: %s", ERROR_MSG[no]);
36 }
37
38 return msg;
39}
const char ERROR_MSG[][80]
Definition: CConvMessage.cpp:9
virtual const char * Msg()
CConvMessage(int No=0, const char *op_msg="",...)
static char msg[256]
Definition: CConvMessage.h:25
char option_msg[256]
Definition: CConvMessage.h:28