Reckon 0.5.1-dev
A Tool to Count Logical Lines of Code
Loading...
Searching...
No Matches
RcnSourceFile Struct Reference

A structure representing a text source file. More...

#include <reckon/reckon.h>

Data Fields

char * path
 The absolute file path of the source code file.
char * name
 The name of the source code file, including the file extension.
char * extension
 The file extension of the source code file, without a leading dot.
RcnSourceText content
 The text content of the source file.
bool isContentRead
 Indicates whether the content of the file has been read from the file system.
RcnFileOpStatus status
 The status code indicating the processing state of the source code file.

Detailed Description

A structure representing a text source file.

Holds metadata and content of a source file to be analyzed. A source file may or may not contain source code written in a programming language. It may as well be regular text, formatted or unformatted. Users typically don't need to create, manipulate or manage the memory of this struct directly, as it is managed internally by the Reckon library to represent and track files.

The file content may or may not be loaded at any given time. Check the isContentRead field to determine if the content was read from the file system. The content.size of a not yet read file is defined to be zero. Thus, empty files that were read will have isContentRead equal to true, content.size of zero and an empty string in content.text.

Field Documentation

◆ content

RcnSourceText RcnSourceFile::content

The text content of the source file.

The content is a null-terminated string. It may only be set if isContentRead is true. The size is the actual size in bytes of the file content on disk.

◆ extension

char* RcnSourceFile::extension

The file extension of the source code file, without a leading dot.

◆ isContentRead

bool RcnSourceFile::isContentRead

Indicates whether the content of the file has been read from the file system.

◆ name

char* RcnSourceFile::name

The name of the source code file, including the file extension.

◆ path

char* RcnSourceFile::path

The absolute file path of the source code file.

◆ status

RcnFileOpStatus RcnSourceFile::status

The status code indicating the processing state of the source code file.