FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
CNFMessage.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/*
6 CNFMessage ver.1.0
7*/
8
9#include <stdio.h>
10#include "CNFMessage.h"
11
12static char ERROR_MSG[][80] = {
13 "No error", "Unknown error", "Cannot open NEU file",
14 "Read data error", "Data line required", "Data block required",
15 "Invalid token", "Item requred", "A record is required"};
16
17static char WARNING_MSG[][80] = {"Non supported data block"};
18
19char CNFMessage::msg[256] = "";
20
21const char *CNFError::Msg() {
22 char s[256];
23 strcpy(msg, "##Error");
24
25 if (line >= 0) {
26 sprintf(s, "(line:%d", line);
27 strcat(msg, s);
28
29 if (column > 0) {
30 sprintf(s, ",col:%d", column);
31 strcat(msg, s);
32 }
33
34 strcat(msg, ")");
35 }
36
37 strcat(msg, ": ");
38 strcat(msg, ERROR_MSG[no]);
39 strcat(msg, option_msg);
40 return msg;
41}
42
43const char *CNFWarning::Msg() {
44 char s[256];
45 strcpy(msg, "##Warning");
46
47 if (line >= 0) {
48 sprintf(s, "(line:%d", line);
49 strcat(msg, s);
50
51 if (column > 0) {
52 sprintf(s, ",col:%d", column);
53 strcat(msg, s);
54 }
55
56 strcat(msg, ")");
57 }
58
59 strcat(msg, ": ");
60 strcat(msg, WARNING_MSG[no]);
61 strcat(msg, option_msg);
62 return msg;
63}
const char ERROR_MSG[][80]
Definition: CConvMessage.cpp:9
virtual const char * Msg()
Definition: CNFMessage.cpp:21
int column
Definition: CNFMessage.h:40
static char msg[256]
Definition: CNFMessage.h:35
char option_msg[256]
Definition: CNFMessage.h:41
virtual const char * Msg()
Definition: CNFMessage.cpp:43