InputStream.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * InputStream.h
  3. * Copyright © 2012 kbinani
  4. *
  5. * This file is part of vConnect-STAND.
  6. *
  7. * vConnect-STAND is free software; you can redistribute it and/or
  8. * modify it under the terms of the GPL License.
  9. *
  10. * vConnect-STAND is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. */
  14. #ifndef __InputStream_h__
  15. #define __InputStream_h__
  16. #include <string>
  17. namespace vconnect
  18. {
  19. using namespace std;
  20. /**
  21. * テキストを読み込むストリーム
  22. */
  23. class InputStream
  24. {
  25. public:
  26. /**
  27. * ストリームを閉じる
  28. */
  29. virtual void close() = 0;
  30. /**
  31. * ストリームから1行分のデータを読み込む
  32. * @return 1行分のデータ
  33. */
  34. virtual string readLine() = 0;
  35. /**
  36. * ストリームに対してさらに読み込めるかどうか
  37. * @return 読み込める状態であれば true を返す
  38. */
  39. virtual bool ready() = 0;
  40. /**
  41. * デストラクタ
  42. */
  43. virtual ~InputStream()
  44. {
  45. }
  46. };
  47. }
  48. #endif