clip icon indicating copy to clipboard operation
clip copied to clipboard

clear() and empty_format()

Open ayykamp opened this issue 4 years ago • 1 comments

I'm trying to use clip::has(clip::empty_format()) I tried the following:

#include "clip.h"
#include <iostream>

int main(int argc, char* argv[]) {
  clip::clear();
  std::cout << std::boolalpha << clip::has(clip::empty_format()) << std::endl;
}

But it outputs false even though directly before I clear the clipboard. Am I doing something wrong?

ayykamp avatar Nov 15 '19 18:11 ayykamp

Hi @AyyKamp! Actually never thought about that possibility (even more, the empty_format is almost never used in the whole project). I'll leave this issue open like an opportunity to check if the clipboard is completely empty with clip::has(clip::empty_format()) as you have used.

In the meanwhile you can use clip::has(...) other formats to check if you should enable/disable your options to paste content from the clipboard in the specific format.

Sorry for the inconvenience.

dacap avatar Nov 15 '19 18:11 dacap