LNITFFile::GetNITFHeader

#include "ltwrappr.h"

L_INT LNITFFile::GetNITFHeader(pNITFHeader)

pNITFHEADER pNITFHeader;

/* pointer to a NITFHEADER structure */

Retrieves the NITF file header information. This function is available in the Document Toolkit.

Parameter

Description

pNITFHeader

Pointer to a NITFHEADER structure to be updated with the NITF file header information.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

To change the NITF file header information, call the LNITFFile::SetNITFHeader function.

Required DLLs and Libraries

LTNTF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LNITFFile::Create, LNITFFile::Destroy, LNITFFile::GetStatus, LNITFFile::SaveFile, LNITFFile::AppendImageSegment, LNITFFile::AppendGraphicSegment, LNITFFile::AppendTextSegment, LNITFFile::GetVector, LNITFFile::SetVector, LNITFFile::SetNITFHeader, LNITFFile::GetGraphicHeaderCount, LNITFFile::GetGraphicHeader, LNITFFile::SetGraphicHeader, LNITFFile::GetImageHeaderCount, LNITFFile::GetImageHeader, LNITFFile::SetImageHeader, LNITFFile::GetTextHeaderCount, LNITFFile::GetTextHeader, LNITFFile::SetTextHeader.

Topics:

NITF Functions: Getting and Setting Header Information

 

Programming with LEADTOOLS NITF Functions.

Example

L_INT LNITFFile_GetNITFHeaderExample()
{
   WRPUNLOCKSUPPORT();
   LNITFFile Nitf;
   Nitf.Create ();
   L_UINT uFlags = 0;
   NITFHEADER NITFHeader; 
   memset(&NITFHeader, 0, sizeof(NITFHeader)); 
   // Parse the NITF file
   Nitf.Create (TEXT("C:\\Program Files\\LEAD Technologies\\LEADTOOLS 15\\Images\\test.ntf"));
   // Check if the hNITF is empty or invalid
   uFlags = Nitf.GetStatus ();
   if((uFlags & NITF_FILE_EMPTY) == NITF_FILE_EMPTY) 
   {
      MessageBox(NULL, TEXT("NITF file is empty"), 0, 0);
      return SUCCESS;
   }
   if((uFlags & NITF_FILE_VALID) != NITF_FILE_VALID) 
   {
      MessageBox(NULL, TEXT("NITF file is invalid"), 0, 0);
      return SUCCESS;
   }
   // Update the NITF file header
   if(Nitf.GetNITFHeader(&NITFHeader) == SUCCESS) 
   {
      NITFHeader.pFTITLE = "LEAD Technologies, Inc";
      Nitf.SetNITFHeader (&NITFHeader); 
      Nitf.FreeNITFHeader (&NITFHeader);
   }
   Nitf.Destroy ();
   return SUCCESS;
}