Loading...
Searching...
No Matches
buffer.h
Go to the documentation of this file.
#ifndef ARC_CONSOLE_LINE_BUFFER_H_
#define ARC_CONSOLE_LINE_BUFFER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "arc/console/view.h"
#include "arc/std/string.h"
/**
* @brief
*/
typedef struct ARC_ConsoleBuffer ARC_ConsoleBuffer;
/**
* @brief creates ARC_ConsoleBuffer type
*
* @param buffer ARC_ConsoleBuffer to create
*/
void ARC_ConsoleBuffer_Create(ARC_ConsoleBuffer **buffer);
/**
* @brief destroys ARC_ConsoleBuffer type
*
* @param buffer ARC_ConsoleBuffer to destroy
*/
void ARC_ConsoleBuffer_Destroy(ARC_ConsoleBuffer *buffer);
/**
* @brief clears the contents of a ARC_ConsoleBuffer
*
* @param buffer ARC_ConsoleBuffer to clear
*/
void ARC_ConsoleBuffer_Clear(ARC_ConsoleBuffer *buffer);
/**
* @brief renders a buffer to a ARC_ConsoleView
*
* @param buffer ARC_ConsoleBuffer to render
* @param view ARC_ConsoleView to render the buffer contents to
*/
void ARC_ConsoleBuffer_Render(ARC_ConsoleBuffer *buffer, ARC_ConsoleView *view);
/**
* @brief renders a section of buffer to a ARC_ConsoleView
*
* @param buffer ARC_ConsoleBuffer to render
* @param view ARC_ConsoleView to render the buffer contents to
* @param startIndex start index of buffer to render
* @param lines the number of lines of buffer to render
*/
void ARC_ConsoleBuffer_RenderSection(ARC_ConsoleBuffer *buffer, ARC_ConsoleView *view, uint32_t startIndex, uint32_t lines);
/**
* @brief adds a character to the buffer
*
* @param buffer ARC_ConsoleBuffer to add character to
* @param character char to add to ARC_ConsoleBuffer
*/
void ARC_ConsoleBuffer_AddChar(ARC_ConsoleBuffer *buffer, char character);
/**
* @brief adds an ARC_String to the buffer
*
* @param buffer ARC_ConsoleBuffer to add character to
* @param string ARC_String to add to ARC_ConsoleBuffer
*/
void ARC_ConsoleBuffer_AddString(ARC_ConsoleBuffer *buffer, ARC_String *string);
/**
* @brief adds a cstring to the buffer
*
* @param buffer ARC_ConsoleBuffer to add character to
* @param string cstring to add to ARC_ConsoleBuffer
* @param length the length of the c string to add
*/
void ARC_ConsoleBuffer_AddCString(ARC_ConsoleBuffer *buffer, char *cstring, uint64_t length);
/**
* @brief adds a cstring to the buffer with the cstrings string length
*
* @param buffer ARC_ConsoleBuffer to add character to
* @param string cstring to add to ARC_ConsoleBuffer
*/
void ARC_ConsoleBuffer_AddCStringWithStrlen(ARC_ConsoleBuffer *buffer, char *cstring);
/**
* @brief gets the number of lines from a console line buffer
*
* @param buffer ARC_ConsoleBuffer get number of lines from
*
* @return the number of lines within an ARC_ConsoleBuffer
*/
uint32_t ARC_ConsoleBuffer_GetLineNumbers(ARC_ConsoleBuffer *buffer);
#ifdef __cplusplus
}
#endif
#endif //!ARC_CONSOLE_LINE_BUFFER_H_
ARC_ConsoleBuffer
struct ARC_ConsoleBuffer ARC_ConsoleBuffer
Definition buffer.h:15
ARC_ConsoleBuffer_AddChar
void ARC_ConsoleBuffer_AddChar(ARC_ConsoleBuffer *buffer, char character)
adds a character to the buffer
ARC_ConsoleBuffer_Render
void ARC_ConsoleBuffer_Render(ARC_ConsoleBuffer *buffer, ARC_ConsoleView *view)
renders a buffer to a ARC_ConsoleView
ARC_ConsoleBuffer_GetLineNumbers
uint32_t ARC_ConsoleBuffer_GetLineNumbers(ARC_ConsoleBuffer *buffer)
gets the number of lines from a console line buffer
ARC_ConsoleBuffer_AddCStringWithStrlen
void ARC_ConsoleBuffer_AddCStringWithStrlen(ARC_ConsoleBuffer *buffer, char *cstring)
adds a cstring to the buffer with the cstrings string length
ARC_ConsoleBuffer_RenderSection
void ARC_ConsoleBuffer_RenderSection(ARC_ConsoleBuffer *buffer, ARC_ConsoleView *view, uint32_t startIndex, uint32_t lines)
renders a section of buffer to a ARC_ConsoleView
ARC_ConsoleBuffer_Create
void ARC_ConsoleBuffer_Create(ARC_ConsoleBuffer **buffer)
creates ARC_ConsoleBuffer type
ARC_ConsoleBuffer_AddCString
void ARC_ConsoleBuffer_AddCString(ARC_ConsoleBuffer *buffer, char *cstring, uint64_t length)
adds a cstring to the buffer
ARC_ConsoleBuffer_AddString
void ARC_ConsoleBuffer_AddString(ARC_ConsoleBuffer *buffer, ARC_String *string)
adds an ARC_String to the buffer
ARC_ConsoleBuffer_Destroy
void ARC_ConsoleBuffer_Destroy(ARC_ConsoleBuffer *buffer)
destroys ARC_ConsoleBuffer type
ARC_ConsoleBuffer_Clear
void ARC_ConsoleBuffer_Clear(ARC_ConsoleBuffer *buffer)
clears the contents of a ARC_ConsoleBuffer
view.h
ARC_ConsoleView
struct ARC_ConsoleView ARC_ConsoleView
Definition view.h:18
string.h
ARC_String
substring position within a string
Definition string.h:14