FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
CFSTRDB_Write.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  CFSTRDB_Write Ver.1.0
7 */
8 
9 #include "CFSTRDB.h"
10 #include "CHECData.h"
11 
12 using namespace std;
13 
15  : CFSTRDataBlock(FSTRDB_WRITE), result(0), visual(0) {}
16 
18 
20 
22  char header_s[256];
23  size_t len = snprintf(header_s, sizeof(header_s), "!WRITE");
24 
25  if (result)
26  len += snprintf(header_s + len, sizeof(header_s) - len, ",RESULT");
27 
28  if (visual) snprintf(header_s + len, sizeof(header_s) - len, ",VISUAL");
29 
30  hecd->WriteHeader(header_s);
31 }
32 
33 bool CFSTRDB_Write::Read(CHECData *hecd, char *header_line) {
34  int rcode[10];
35 
36  if (!hecd->ParseHeader(header_line, rcode, "EE", "RESULT", &result, "VISUAL",
37  &visual))
38  return false;
39 
40  return true;
41 }
@ FSTRDB_WRITE
Definition: CFSTRDB.h:31
virtual void Clear()
virtual bool Read(class CHECData *hecd, char *header_line)
virtual ~CFSTRDB_Write()
virtual void Write(class CHECData *hecd)
virtual bool ParseHeader(char *header_line, int *rcode, const char *fmt,...)
Definition: CHECData.cpp:494
virtual void WriteHeader(const char *name, const char *fmt="",...)
Definition: CHECData.cpp:68