FulcrumFS FulcrumFS
FulcrumFS FulcrumFS
DocFX + Singulink = ♥

Search Results for

    Class FileFormat

    Represents a file format that can be used to validate that a file's content matches its declared extension.

    Inheritance
    object
    FileFormat
    Namespace: FulcrumFS
    Assembly: FulcrumFS.Core.dll
    Syntax
    public abstract class FileFormat
    Remarks

    Each FileFormat represents one specific file format with a fixed set of extensions. The base library provides built-in singletons for common formats accessible via static properties (Jpeg, Png, Pdf, etc.).

    Content-agnostic and text-based file formats can be created using the factory methods (AnyContent(params ReadOnlySpan<string>), TextAscii(params ReadOnlySpan<string>), TextUnicode(params ReadOnlySpan<string>), TextEncoding(Encoding, params ReadOnlySpan<string>)) where the caller specifies the applicable extensions.

    Custom file formats can be created by deriving from FileFormat and implementing ValidateAsync(Stream, CancellationToken).

    FileFormat is independent of the FulcrumFS repository infrastructure and can be used standalone — for example, to validate user uploads in a front-end application before sending them to a service that hosts a FulcrumFS repository.

    Constructors

    Name Description
    FileFormat()

    Initializes a new instance of the FileFormat class.

    Properties

    Name Description
    Avi

    Gets the AVI media file format. Extension: .avi.

    Avif

    Gets the AVIF image file format. Extension: .avif.

    Bmp

    Gets the BMP image file format. Extensions: .bmp (primary), .bm, .dip.

    Doc

    Gets the legacy Microsoft Word (DOC) file format. Extension: .doc. Validates the OLE Compound Document signature and verifies the contained document is a Word document by inspecting the directory entries for the 'WordDocument' stream.

    Docx

    Gets the DOCX (Office Open XML Word document) file format. Extension: .docx.

    Dwg

    Gets the AutoCAD DWG drawing file format. Extension: .dwg. Validates the DWG version signature.

    Dxf

    Gets the AutoCAD DXF drawing exchange file format. Extension: .dxf. Validates the ASCII section header or binary DXF sentinel.

    EDrawingsAssembly

    Gets the eDrawings assembly (EASM) file format. Extension: .easm. Validates that the file is either a ZIP archive containing the required eModel entry (modern documents) or a HOOPS Stream Format file (legacy documents and SolidWorks Simulation analysis exports).

    Epub

    Gets the EPUB e-book file format. Extension: .epub.

    ExcellonDrill

    Gets the Excellon drill file format. Extension: .drl. Validates the M48 header command.

    Extensions

    Gets the file extensions associated with this file format (including the leading dot, e.g., ".jpg").

    Flac

    Gets the FLAC audio file format. Extension: .flac.

    Gerber

    Gets the Gerber (RS-274X) PCB layer file format. Extension: .gbr. Validates the mandatory format specification and unit mode commands.

    GerberJob

    Gets the Gerber job file format. Extension: .gbrjob. Validates the JSON structure with its mandatory Header section.

    Gif

    Gets the GIF image file format. Extension: .gif.

    Heic

    Gets the HEIC image file format. Extension: .heic.

    Heif

    Gets the HEIF image file format. Extensions: .heif (primary), .heifs, .hif.

    Iges

    Gets the IGES CAD model file format. Extensions: .igs (primary), .iges. Validates the fixed-column start section record.

    Jpeg

    Gets the JPEG image file format. Extensions: .jpg (primary), .jpeg, .jfif.

    M2ts

    Gets the MPEG-TS (192-byte packet, Blu-ray style) media file format. Extensions: .m2ts (primary), .mts.

    M4a

    Gets the MPEG-4 audio (M4A) media file format. Extension: .m4a.

    Mj2

    Gets the Motion JPEG 2000 (MJ2) media file format. Extension: .mj2.

    Mkv

    Gets the Matroska (MKV) media file format. Extension: .mkv.

    Mov

    Gets the QuickTime (MOV) media file format. Extension: .mov.

    Mp3

    Gets the MP3 audio file format. Extension: .mp3.

    Mp4

    Gets the MP4 media file format. Extension: .mp4.

    Mp4Loose

    Gets the loose MP4 media file format. Extensions: .mp4 (primary), .mov, .m4a, .3gp, .3g2, .mj2.

    Mpeg

    Gets the MPEG-PS media file format. Extensions: .mpg (primary), .mpeg.

    Name

    Gets the name of the file format (e.g., "JPEG", "PDF", "TextUnicode").

    Odp

    Gets the ODP (OpenDocument presentation) file format. Extension: .odp.

    Ods

    Gets the ODS (OpenDocument spreadsheet) file format. Extension: .ods.

    Odt

    Gets the ODT (OpenDocument text) file format. Extension: .odt.

    Ogg

    Gets the Ogg media file format. Extensions: .ogg (primary), .oga, .ogv, .opus.

    Pdf

    Gets the PDF document file format. Extension: .pdf.

    Png

    Gets the PNG image file format. Extensions: .png (primary), .apng.

    Ppt

    Gets the legacy Microsoft PowerPoint (PPT) file format. Extension: .ppt. Validates the OLE Compound Document signature and verifies the contained document is a PowerPoint presentation by inspecting the directory entries for the 'PowerPoint Document' stream.

    Pptx

    Gets the PPTX (Office Open XML presentation) file format. Extension: .pptx.

    PrimaryExtension

    Gets the primary file extension associated with this file format (including the leading dot). This is the first extension in Extensions and is the extension that files of this format are written with when added to a FulcrumFS repository.

    Rtf

    Gets the RTF document file format. Extension: .rtf.

    SolidWorksAssembly

    Gets the SolidWorks assembly (SLDASM) file format. Extension: .sldasm. Validates the modern SolidWorks document container signature (prefix plus a Contents entry), or for legacy documents, validates the OLE Compound Document container signature and rejects files whose contents identify them as one of the other known OLE document types.

    SolidWorksDrawing

    Gets the SolidWorks drawing (SLDDRW) file format. Extension: .slddrw. Validates the modern SolidWorks document container signature (prefix plus a Contents entry), or for legacy documents, validates the OLE Compound Document container signature and rejects files whose contents identify them as one of the other known OLE document types.

    SolidWorksPart

    Gets the SolidWorks part (SLDPRT) file format. Extension: .sldprt. Validates the modern SolidWorks document container signature (prefix plus a Contents entry), or for legacy documents, validates the OLE Compound Document container signature and rejects files whose contents identify them as one of the other known OLE document types.

    Step

    Gets the STEP (ISO 10303-21) CAD model file format. Extensions: .step (primary), .stp. Validates the ISO 10303-21 exchange file header.

    Tg2

    Gets the 3GPP2 (3G2) media file format. Extension: .3g2.

    Tgp

    Gets the 3GPP (3GP) media file format. Extension: .3gp.

    Tiff

    Gets the TIFF image file format. Extensions: .tif (primary), .tiff.

    Ts

    Gets the MPEG-TS (188-byte packet) media file format. Extension: .ts.

    Wav

    Gets the WAV audio file format. Extension: .wav.

    WebM

    Gets the WebM media file format. Extension: .webm.

    WebP

    Gets the WebP image file format. Extension: .webp.

    Xls

    Gets the legacy Microsoft Excel (XLS) file format. Extension: .xls. Validates the OLE Compound Document signature and verifies the contained document is an Excel workbook by inspecting the directory entries for the 'Workbook' or 'Book' stream.

    Xlsm

    Gets the XLSM (Office Open XML macro-enabled spreadsheet) file format. Extension: .xlsm.

    Xlsx

    Gets the XLSX (Office Open XML spreadsheet) file format. Extension: .xlsx.

    Zip

    Gets the ZIP archive file format. Extension: .zip.

    Methods

    Name Description
    AnyContent(params ReadOnlySpan<string>)

    Creates a FileFormat that accepts any content for the specified extensions. No content validation is performed beyond ensuring the file's extension is one of the specified extensions.

    TextAscii(params ReadOnlySpan<string>)

    Creates a FileFormat that validates files are valid ASCII text for the specified extensions. All bytes in the file must be in the range [0, 127] (i.e. IsValid(ReadOnlySpan<byte>) must return true).

    TextEncoding(Encoding, params ReadOnlySpan<string>)

    Creates a FileFormat that validates files decode successfully using the specified Encoding, for the specified extensions.

    TextUnicode(UnicodeEncodings, params ReadOnlySpan<string>)

    Creates a FileFormat that validates files are valid Unicode text in one of the specified encodings, for the specified extensions.

    TextUnicode(params ReadOnlySpan<string>)

    Creates a FileFormat that validates files are valid Unicode text in any encoding supported by All, for the specified extensions.

    ToString()

    Returns a string that represents the current object.

    ValidateAsync(Stream, CancellationToken)

    Validates the content of the specified stream against this file format. The stream must be seekable and positioned at 0 at the start of this call.

    © Singulink. All rights reserved.