OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
checksum_model.h
Go to the documentation of this file.
1//Copyright> OpenRadioss
2//Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3//Copyright>
4//Copyright> This program is free software: you can redistribute it and/or modify
5//Copyright> it under the terms of the GNU Affero General Public License as published by
6//Copyright> the Free Software Foundation, either version 3 of the License, or
7//Copyright> (at your option) any later version.
8//Copyright>
9//Copyright> This program is distributed in the hope that it will be useful,
10//Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11//Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12//Copyright> GNU Affero General Public License for more details.
13//Copyright>
14//Copyright> You should have received a copy of the GNU Affero General Public License
15//Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16//Copyright>
17//Copyright>
18//Copyright> Commercial Alternative: Altair Radioss Software
19//Copyright>
20//Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21//Copyright> software under a commercial license. Contact Altair to discuss further if the
22//Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23
24#include <iostream>
25#include <iomanip>
26#include <fstream>
27#include <string>
28#include <list>
29#include <stdio.h>
30#include <stdlib.h>
31#include <sstream>
32#include <string.h>
33#include <tuple>
34#include <md5.h>
35#include <filesystem>
36#include <algorithm>
37#define _FCALL
38
39
41 std::list<std::tuple<int,std::string, md5_state_t, std::string>> md5_states; // List of options : active flag,id, title, checksum digest
42
43 private:
44
45 #ifdef DEBUG
46 int debug=1;
47 #else
48 int debug=0;
49 #endif
50 void remove_carriage_return(std::string& line) ;
51 std::string separator();
52 std::string get_path(const std::string& filepath);
53 void new_checksum( std::string title, std::list<std::tuple<int,std::string, md5_state_t, std::string>> *md5_states_tmp);
54 void process_checksum(std::string line, std::list<std::tuple<int,std::string, md5_state_t, std::string>> *md5_states_tmp);
55 void end_checksum(std::list<std::tuple<int,std::string, md5_state_t, std::string>> *md5_states_tmp);
56 void finalize_checksum(std::list<std::tuple<int,std::string, md5_state_t, std::string>> *md5_states_tmp);
57 int file_read(std::string filename,std::string deck_directory,int level,std::list<std::tuple<int,std::string, md5_state_t, std::string>> *md5_states_tmp);
58
59 public:
60 // --------------------------------------------------------------------------------------------------------
61 // constructor
62 // --------------------------------------------------------------------------------------------------------
64 void parse(std::string filenam);
65 int count();
66 void member(int N,char* checksum_title,int *len_title,char* checksum,int *len_checksum);
67 std::list<std::string> get_checksums();
68 void print();
69 };
70
std::list< std::tuple< int, std::string, md5_state_t, std::string > > md5_states
void end_checksum(std::list< std::tuple< int, std::string, md5_state_t, std::string > > *md5_states_tmp)
void parse(std::string filenam)
std::list< std::string > get_checksums()
std::string get_path(const std::string &filepath)
void member(int N, char *checksum_title, int *len_title, char *checksum, int *len_checksum)
std::string separator()
void process_checksum(std::string line, std::list< std::tuple< int, std::string, md5_state_t, std::string > > *md5_states_tmp)
int file_read(std::string filename, std::string deck_directory, int level, std::list< std::tuple< int, std::string, md5_state_t, std::string > > *md5_states_tmp)
void finalize_checksum(std::list< std::tuple< int, std::string, md5_state_t, std::string > > *md5_states_tmp)
void new_checksum(std::string title, std::list< std::tuple< int, std::string, md5_state_t, std::string > > *md5_states_tmp)
void remove_carriage_return(std::string &line)
#define N