#include "StdAfx.h" #include "dotnetInterface.h" dotnetInterface::dotnetInterface() { //Int = nullptr; Int = new Interface(); } dotnetInterface::dotnetInterface(String^ FileName, bool CheckCrc) { char* name = static_cast(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(FileName).ToPointer()); Int = new Interface(name,CheckCrc); System::Runtime::InteropServices::Marshal::FreeHGlobal(safe_cast(name)); } dotnetInterface::~dotnetInterface() { delete Int; } // les méthodes d'accès pour les champs de la PAT unsigned int dotnetInterface::GetPATTableID() { return Int->GetPATTableID(); } void dotnetInterface::SetPATTableID(unsigned int newTableID) { Int->SetPATTableID(newTableID); } bool dotnetInterface::GetPATSection_syntax_indicator() { return Int->GetPATSection_syntax_indicator(); } void dotnetInterface::SetPATSection_syntax_indicator() { Int->SetPATSection_syntax_indicator(); } void dotnetInterface::ClearPATSection_syntax_indicator() { Int->ClearPATSection_syntax_indicator(); } unsigned int dotnetInterface::GetPATSection_length() { return Int->GetPATSection_length(); } void dotnetInterface::SetPATSection_length(unsigned int newSection_length) { Int->SetPATSection_length(newSection_length); } unsigned int dotnetInterface::GetPATTransport_streamID() { return Int->GetPATTransport_streamID(); } void dotnetInterface::SetPATTransport_streamID(unsigned int newTS_ID) { Int->SetPATTransport_streamID(newTS_ID); } unsigned int dotnetInterface::GetPATVersion_number() { return Int->GetPATVersion_number(); } void dotnetInterface::SetPATVersion_number(unsigned int newVersion_number) { Int->SetPATVersion_number(newVersion_number); } bool dotnetInterface::GetPATCurrent_next_indicator() { return Int->GetPATCurrent_next_indicator(); } void dotnetInterface::SetPATCurrent_next_indicator() { Int->SetPATCurrent_next_indicator(); } void dotnetInterface::ClearPATCurrent_next_indicator() { Int->ClearPATCurrent_next_indicator(); } unsigned int dotnetInterface::GetPATSection_number() { return Int->GetPATSection_number(); } void dotnetInterface::SetPATSection_number(unsigned int newSection_number) { Int->SetPATSection_number(newSection_number); } unsigned int dotnetInterface::GetPATLast_section_number() { return Int->GetPATLast_section_number(); } void dotnetInterface::SetPATLast_section_number(unsigned int newLast_section_number) { Int->SetPATLast_section_number(newLast_section_number); } unsigned int dotnetInterface::GetPATNetwork_PID() { return Int->GetPATNetwork_PID(); } void dotnetInterface::SetPATNetwork_PID(unsigned int newNetwork_PID) { Int->SetPATNetwork_PID(newNetwork_PID); } //List dotnetInterface::GetPATProgram_number() //{ // return Int->GetPATProgram_number(); //} //void dotnetInterface::SetPATProgram_number(int indice, unsigned int newProgram_number) //{ // Int->SetPATProgram_number(indice,newProgram_number); //} //List dotnetInterface::GetPATProgram_map_PID() //{ // return Int->GetPATProgram_map_PID(); //} //void dotnetInterface::SetPATProgram_map_PID(int indice, unsigned int newProgram_map_PID) //{ // Int->SetPATProgram_map_PID(indice, newProgram_map_PID); //} /////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////Interface pour la partie catalogue/////////////////////// /////////////////////////////////////////////////////////////////////////////////////// // fonction qui renvoit le nom d'un fichier se trouvant dans le catalogue string dotnetInterface::GetCatalogueName(int indice) { return Int->GetName(indice); } // fonction qui renvoit la taille d'un fichier se trouvant dans le catalogue unsigned int dotnetInterface::GetCatalogueSize(int indice) { return Int->GetSize(indice); } // fonction qui renvoit la description d'un fichier se trouvant dans le catalogue string dotnetInterface::GetCatalogueDescription(int indice) { return Int->GetDescription(indice); } // fonction qui ajoute un fichier TS au catalogue void dotnetInterface::AddAFileToCatalogue(string NameData, string SizeData, string DescriptionData) { Int->AddAFile(NameData,SizeData,DescriptionData); } // fonction qui va retirer un fichier TS du catalogue void dotnetInterface::RemoveFileTSFromCatalogue(int indice) { Int->RemoveFileTS(indice); } // fonction qui va convertir les String^ en string de la STL string dotnetInterface::StringTostringSTL(String^ s) { return charTostringSTL(StringTochar(s)); } // fonction qui va convertir les String^ en char* char* dotnetInterface::StringTochar(String^ s) { char* c = static_cast(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(s).ToPointer()); return c ; System::Runtime::InteropServices::Marshal::FreeHGlobal(safe_cast(c)); } // fonction qui va convertir les char* en string de la STL string dotnetInterface::charTostringSTL(char* c) { string s = c; return s; } /////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////