network_filesystem.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (c) 2012-2014 Daniele Bartolini and individual contributors.
  3. * License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. */
  5. #include "json_parser.h"
  6. #include "network_file.h"
  7. #include "network_filesystem.h"
  8. #include "os.h"
  9. #include "string_utils.h"
  10. #include "temp_allocator.h"
  11. #include "string_stream.h"
  12. namespace crown
  13. {
  14. NetworkFilesystem::NetworkFilesystem()
  15. {
  16. }
  17. NetworkFilesystem::NetworkFilesystem(const NetAddress& addr, uint16_t port)
  18. : _address(addr)
  19. , _port(port)
  20. {
  21. }
  22. File* NetworkFilesystem::open(const char* path, FileOpenMode mode)
  23. {
  24. return CE_NEW(default_allocator(), NetworkFile)(_address, _port, path);
  25. }
  26. void NetworkFilesystem::close(File* file)
  27. {
  28. CE_ASSERT_NOT_NULL(file);
  29. CE_DELETE(default_allocator(), file);
  30. }
  31. bool NetworkFilesystem::exists(const char* path)
  32. {
  33. return false;
  34. }
  35. bool NetworkFilesystem::is_directory(const char* path)
  36. {
  37. return false;
  38. }
  39. bool NetworkFilesystem::is_file(const char* path)
  40. {
  41. return false;
  42. }
  43. void NetworkFilesystem::create_directory(const char* /*path*/)
  44. {
  45. }
  46. void NetworkFilesystem::delete_directory(const char* /*path*/)
  47. {
  48. }
  49. void NetworkFilesystem::create_file(const char* /*path*/)
  50. {
  51. }
  52. void NetworkFilesystem::delete_file(const char* /*path*/)
  53. {
  54. }
  55. void NetworkFilesystem::list_files(const char* /*path*/, Vector<DynamicString>& /*files*/)
  56. {
  57. }
  58. void NetworkFilesystem::get_absolute_path(const char* path, DynamicString& os_path)
  59. {
  60. }
  61. TCPSocket NetworkFilesystem::new_connection()
  62. {
  63. TCPSocket socket;
  64. socket.connect(_address, _port);
  65. return socket;
  66. }
  67. } // namespace crown