You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.2 KiB
66 lines
1.2 KiB
#include <iostream>
|
|
#include <Windows.h>
|
|
#include <string>
|
|
|
|
#include "rapidxml-1.13/rapidxml.hpp"
|
|
#include "rapidxml-1.13/rapidxml_print.hpp"
|
|
#include "rapidxml-1.13/rapidxml_utils.hpp"
|
|
|
|
#define DEBUG
|
|
|
|
using namespace std;
|
|
|
|
void getClipboardText(string& pasteBin)
|
|
{
|
|
HANDLE clip;
|
|
#ifdef DEBUG
|
|
cout << "Current clipboard: " << pasteBin << endl;
|
|
#endif
|
|
if (OpenClipboard(NULL))
|
|
{
|
|
clip = GetClipboardData(CF_TEXT);
|
|
pasteBin = (char*)clip;
|
|
CloseClipboard();
|
|
#ifdef DEBUG
|
|
cout << "New clipboard: " << pasteBin << endl;
|
|
#endif
|
|
}
|
|
}
|
|
|
|
void getTextToParse(string& pasteBin)
|
|
{
|
|
bool accecpted {false};
|
|
|
|
while (!accecpted) {
|
|
getClipboardText(pasteBin);
|
|
cout << "Your current clipboard is:\n" << pasteBin << endl;
|
|
cout << "Is this the text you would like to parse? (y/n)" << endl;
|
|
char resp;
|
|
cin >> resp;
|
|
|
|
if (resp == 'y')
|
|
accecpted = true;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
int main()
|
|
{
|
|
cout << "Hello Word!\n";
|
|
|
|
string parseText;
|
|
|
|
getTextToParse(parseText);
|
|
|
|
|
|
|
|
// {
|
|
// using namespace rapidxml;
|
|
// xml_document<> doc;
|
|
|
|
// doc.parse<std::string>(currentClip)
|
|
|
|
// }
|
|
|
|
} |