CefWebViewFunLib.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright aXiuShen. All Rights Reserved.
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "Kismet/BlueprintFunctionLibrary.h"
  5. #include "CefWebCookie.h"
  6. //#include "CefZipReader.h"
  7. #include "CefImitateInput.h"
  8. #include "warp_macro.h"
  9. //namespace webview {
  10. class CEFBROWSER_DLL UWebViewFunLibImp
  11. {
  12. public:
  13. /**
  14. * Set web cookie
  15. */
  16. static bool SetCookie(const FString& URL, const webview::FWebCookie& Cookie);
  17. /**
  18. * delete web cookie
  19. */
  20. static bool DeleteCookies(const FString& URL, const FString& CookieName);
  21. /**
  22. * encode url to %%%%
  23. * @param URL :
  24. * @param use_plus : is true spaces will change to "+".
  25. */
  26. static FString EncodeURL(const FString& URL, const bool use_plus = false);
  27. /**
  28. * open external browser
  29. * @param URL
  30. */
  31. static void PopupURL(const FString& URL);
  32. /**
  33. * convert data to base64 string
  34. * @param data To be encoded
  35. * @return Encoding result data
  36. */
  37. static FString Base64Encode(const FString& data);
  38. /**
  39. * Decoding encoded base64 string
  40. * @param base64 Data to be decoded
  41. * @return Decoding result data
  42. */
  43. static FString Base64Decode(const FString& base64);
  44. /**
  45. * convert file content to base64 string
  46. * @param file To be encoded
  47. * @return Encoding result data
  48. */
  49. static FString Base64EncodeFile(const FString& file);
  50. /**
  51. * Decoding encoded base64 string into file
  52. * @param base64 Data to be decoded
  53. * @param SaveFile use to save Decoding result data
  54. * @return false is failed,true is successful
  55. */
  56. static bool Base64DecodeFile(const FString& base64, const FString& SaveFile);
  57. /**
  58. * Compress the directory into a zip file
  59. * @param Dir Directory to be compressed
  60. * @param ZipFile Save compressed file name
  61. * @param IncludeHiddenFiles true Compress hidden files
  62. * @return false is failed,true is successful
  63. */
  64. static bool Zip(const FString& Dir, const FString& ZipFile, const bool IncludeHiddenFiles);
  65. static int KeytoInner(const TArray<FKey>& CombinKey);
  66. };
  67. //}