MCPcopy Create free account
hub / github.com/cinder/Cinder / hasString

Method hasString

src/cinder/Clipboard.cpp:77–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75#endif
76
77bool Clipboard::hasString()
78{
79#if defined( CINDER_MAC )
80 NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
81 NSArray *classArray = [NSArray arrayWithObject:[NSString class]];
82 NSDictionary *options = [NSDictionary dictionary];
83
84 return [pasteboard canReadObjectForClasses:classArray options:options];
85#elif defined( CINDER_COCOA_TOUCH )
86 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
87 return [pasteboard containsPasteboardTypes:UIPasteboardTypeListString];
88#elif defined( CINDER_MSW )
89 std::set<UINT> textFormats;
90 textFormats.insert( CF_TEXT ); textFormats.insert( CF_UNICODETEXT ); textFormats.insert( CF_OEMTEXT );
91 return clipboardContainsFormat( textFormats );
92#elif defined( CINDER_LINUX )
93 return glfwGetClipboardString( (GLFWwindow*)app::getWindow()->getNative() ) != nullptr;
94#endif
95}
96
97bool Clipboard::hasImage()
98{

Callers

nothing calls this directly

Calls 5

clipboardContainsFormatFunction · 0.85
glfwGetClipboardStringFunction · 0.85
getWindowFunction · 0.50
insertMethod · 0.45
getNativeMethod · 0.45

Tested by

no test coverage detected