FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
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 
9 const 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 
16 char CConvMessage::msg[256] = "";
17 
18 CConvMessage::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 
30 const 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 }
CConvMessage::no
int no
Definition: CConvMessage.h:29
CConvMessage::CConvMessage
CConvMessage(int No=0, const char *op_msg="",...)
Definition: CConvMessage.cpp:18
ERROR_MSG
const char ERROR_MSG[][80]
Definition: CConvMessage.cpp:9
CConvMessage::Msg
virtual const char * Msg()
Definition: CConvMessage.cpp:30
CConvMessage::msg
static char msg[256]
Definition: CConvMessage.h:25
CConvMessage::option_msg
char option_msg[256]
Definition: CConvMessage.h:28
CConvMessage.h