
VtifulKernelExcel::constMemory는 Excel의 메모리를 읽기 전용으로 접근할 수 있는 클래스입니다.
constMemory를 사용하는 이유는 Excel의 메모리를 안전하게 읽기 전용으로 접근하기 위해서입니다.
constMemory를 사용하는 방법은 다음과 같습니다.
1. VtifulKernelExcel 객체를 생성합니다.
2. VtifulKernelExcel::constMemory 객체를 생성합니다.
- VtifulKernelExcel::constMemory(const VtifulKernelExcel &excel, const std::string &sheetName, int row, int col, int rowCnt, int colCnt)
- VtifulKernelExcel::constMemory(const VtifulKernelExcel &excel, const std::string &sheetName, int row, int col, int rowCnt, int colCnt, const std::vector &header)
3. constMemory 객체의 메서드를 사용합니다.
- data() : 데이터를 읽어올 수 있습니다.
- row() : 행 번호를 읽어올 수 있습니다.
- col() : 열 번호를 읽어올 수 있습니다.
- header() : 헤더를 읽어올 수 있습니다.
예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
cpp
VtifulKernelExcel excel("example.xlsx");
VtifulKernelExcel::constMemory cm(excel, "Sheet1", 1, 1, 10, 10);
// 데이터를 읽어옵니다.
std::vector data = cm.data();
// 행 번호를 읽어옵니다.
int row = cm.row();
// 열 번호를 읽어옵니다.
int col = cm.col();
// 헤더를 읽어옵니다.
std::vector header = cm.header();
2025-05-01 17:54