Commit 2a9b347c authored by Didier Raboud's avatar Didier Raboud

New upstream version 3.17.11

parent d844b514

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

#ifndef _COMMON_H
#define _COMMON_H
#include<iostream>
#include<string>
#include<string.h>
#include<fstream>
#include<unistd.h>
#include<sstream>
#include<vector>
#include<map>
#include<algorithm>
#include<sstream>
using namespace std;
typedef pair <string, string> STRING_STRING_PAIR;
typedef vector<STRING_STRING_PAIR> PAIR_VECTOR;
/** typedef struct _MODEL_DICT_ */
typedef struct _MODEL_DICT_ MODEL_DICT;
/** typedef map< string, MODEL_DICT> */
typedef map< string, MODEL_DICT> MODEL_DICT_MAP;
/** typedef vector <string> */
typedef vector <string> STRING_VECTOR;
/** typedef map<string, string> */
typedef map<string, string> STRING_PAIR;
/** @struct _MODEL_DICT_
* @brief This structure contains models.dat info
* @var _MODEL_DICT_::s_tech_class
* Member 's_tech_class' contains tech_class info
* @var _MODEL_DICT_::s_sub_class
* Member 's_sub_class' contains sub_class info
* @var _MODEL_DICT_::s_family_class
* Member 's_family_class' contains family_class info
* @var _MODEL_DICT_::s_normal_model_name
* Member 's_normal_model_name' contains update model_name info
* @var _MODEL_DICT_::s_plugin
* Member 's_plugin' contains plugin info
* @var _MODEL_DICT_::s_plugin_reason
* Member 's_plugin_reason' contains plugin-reason info
* @var _MODEL_DICT_::model_variants
* Member 'model_variants' contains vector info of model variants
*/
struct _MODEL_DICT_
{
string s_tech_class;
string s_sub_class;
string s_family_class;
string s_normal_model_name;
int s_plugin;
int s_plugin_reason;
STRING_VECTOR model_variants;
};
#endif
This diff is collapsed.
#ifndef DATDRV_H
#define DATDRV_H
#include "Normalize.h"
#define MAX_DRV_COUNT 2
#define MAX_DIRECTORY_SIZE 1024
#define COLOR_LASERJET "color laserjet"
#define LASERJET "laserjet"
#define PHOTOSMART "photosmart"
#define DESKJET "deskjet"
#define COLOR_INKJET_PRINTER "color inkjet printer"
#define OFFICEJET "officejet"
#define BUSINESS_INKJET "business inkjet"
#define DESIGNJET "designjet"
#define PRINTER_SCANNER_COPIER "printer scanner copier"
#define COLOR_LJ "color lj"
#define PROFESSIONAL "professional"
#define COLOR_LASERJET_REPLACEMENT "CJL"
#define LASERJET_REPLACEMENT "LJ"
#define PHOTOSMART_REPLACEMENT "PS"
#define DESKJET_REPLACEMENT "DJ"
#define COLOR_INKJET_PRINTER_REPLACEMENT ""
#define OFFICEJET_REPLACEMENT "OJ"
#define BUSINESS_INKJET_REPLACEMENT "BIJ"
#define DESIGNJET_REPLACEMENT "DESIGNJ"
#define PRINTER_SCANNER_COPIER_REPLACEMENT "PSC"
#define COLOR_LJ_REPLACEMENT "CLJ"
#define PROFESSIONAL_REPLACEMENT "Pro"
#define POST_SCRIPT "Postscript"
#define PDF "PDF"
#define MAX_SHORTENING_REPLACEMENTS 11
/** extern string FAMILY_CLASSES from Models.cpp */
extern string FAMILY_CLASSES[MAX_FAMILY_CLASS];
/** extern string TECH_CLASSES from Models.cpp */
extern string TECH_CLASSES[MAX_TECH_CLASS];
/** extern string TECH_SUBCLASSES from Models.cpp */
extern string TECH_SUBCLASSES[MAX_SUB_CLASS];
/** extern string SHORTENING_REPLACEMENTS from Models.cpp */
extern string SHORTENING_REPLACEMENTS[MAX_SHORTENING_REPLACEMENTS];
/** extern string SHORTENING_REPLACEMENTS_VALUE from Models.cpp */
extern string SHORTENING_REPLACEMENTS_VALUE[MAX_SHORTENING_REPLACEMENTS];
/** extern string TECH_CLASS_KEYS from Models.cpp */
extern string TECH_CLASS_KEYS[MAX_TECH_CLASS_PDL];
/** extern string TECH_CLASS_VALUES from Models.cpp */
extern string TECH_CLASS_VALUES[MAX_TECH_CLASS_PDL];
/** @struct _DRV_DATA_
* @brief This structure contains files path & file name info
* @var _DRV_DATA_::current_path
* Member 'current_path' contains source path info
* @var _DRV_DATA_::dat_path
* Member 'dat_path' contains model.path path info
* @var _DRV_DATA_::drv_dir
* Member 'drv_dir' contains drv path info
* @var _DRV_DATA_::drv_in_template[MAX_DRV_COUNT]
* Member 'drv_in_template[MAX_DRV_COUNT]' contains template names info
* @var _DRV_DATA_::drv_in[MAX_DRV_COUNT];
* Member 'drv_in[MAX_DRV_COUNT];' contains update template drv in names info
*/
typedef struct _DRV_DATA_
{
string current_path;
string dat_path;
string drv_dir;
string drv_in_template;
string drv_in;
}DRV_DATA;
/** used for spacing in drv files */
string indent1 = "";
string indent2 = "";
/** global string used to write data in drv files */
string write_data = "";
/** @brief Intialize the variable
*
* @param drv_data object of DRV_DATA passed as a reference variable
* @return void
*
*/
void InitDrvData(DRV_DATA &drv_data);
/** @brief create map of model.dat
*
* @param drv_value object of DRV_DATA
* @return MODEL_DICT_MAP
*/
MODEL_DICT_MAP CreateModelDict(DRV_DATA drv_value);
/** @brief replace substring
*
* @param model_name model name of the device
* @return string
*/
string FixFileName(string model_name);
/** @brief short the length of model name
*
* @param model_name model name of the device passed as reference variable
* @return void
*/
void ShortModelLength(string &model_name);
/** @brief convert the vector into the string
*
* @param sub_class vector of sub classes
* @return string
*/
string SetSubClass(STRING_VECTOR sub_class);
/** @brief setting the path of the model.dat, drv & set the name of template files
*
* @return DRV_DATA
*
*/
DRV_DATA SetFileInfo();
/** @brief check the tech_class passed exsist or not
*
* @param tech_class name of the tech_class
* @return int
*
*/
int TechClassExsist(string tech_class);
/** @brief check the sub_class passed exsist or not
*
* @param sub_class vector of sub classes
* @return unsigned char
*
*/
unsigned char SubClassExsist(STRING_VECTOR sub_class);
/** @brief matches device with same tech class and subclass Name
*
* @param model_dict map of models.dat
* @param sub_class vector of subclasses
* @param subclass subclass name
* @param tech_class tech_class name
* @return STRING_VECTOR
*/
STRING_VECTOR CreateTechClassMatch(MODEL_DICT_MAP model_dict, STRING_VECTOR sub_class, string subclass, string tech_class);
/** @brief checks whether a family_class exsist
*
* @param family_class family class name
* @return unsigned char
*
*/
unsigned char FamilyClassExsist(string family_class);
/** @brief checks whether a model name exsist or not
*
* @param model_name model name of the device
* @param model_dict map of models.dat
* @return unsigned char
*
*/
unsigned char CheckModelNameExsist(string model_name, MODEL_DICT_MAP &model_dict);
/** @brief checks whether a family match exsist or not
*
* @param model_dict map of model_dict
* @param family_class family class name
* @return STRING_VECTOR
*