-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscanner.h
More file actions
33 lines (27 loc) · 1.08 KB
/
scanner.h
File metadata and controls
33 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/////////////////////////////////////////////////////////////////////////////
// Name: scanner.h
// Purpose: Header file for scanner.cpp
// Author: Jan Buchholz
// Created: 2025-11-12
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include <filesystem>
#include <string>
#include <vector>
#include "translationfile.h"
class Scanner {
public:
explicit Scanner(const TranslationFile* tf);
std::vector<mo_single_translation> scanFolder();
std::vector<std::string> processFile(const std::filesystem::path& filepath);
private:
std::string removeComments(const std::string& code);
std::string mergeStringLiterals(const std::string& code);
std::vector<std::string> extractTranslationStrings(const std::string& code);
std::vector<std::string> splitAtNewline(const std::string& input);
bool wildcardMatch(const std::string& pattern, const std::string& target);
const TranslationFile* m_tf;
std::vector<std::string> m_exclusionList;
std::string m_projectFolder;
mt_extensions m_extensions;
};