Austin Tankiang | 9ccaf68 | 2019-06-06 15:05:55 +1000 | [diff] [blame] | 1 | // Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CROS_DISKS_FILESYSTEM_LABEL_H_ |
| 6 | #define CROS_DISKS_FILESYSTEM_LABEL_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | namespace cros_disks { |
| 11 | |
| 12 | enum class LabelErrorType { |
| 13 | kLabelErrorNone = 0, |
| 14 | kLabelErrorUnsupportedFilesystem = 1, |
| 15 | kLabelErrorLongName = 2, |
| 16 | kLabelErrorInvalidCharacter = 3, |
| 17 | }; |
| 18 | |
| 19 | // Returns true if the file system type is supported, and |volume_label| |
| 20 | // contains only allowed characters and length is not greater than the file |
| 21 | // system's limit. |
| 22 | LabelErrorType ValidateVolumeLabel(const std::string& volume_label, |
| 23 | const std::string& filesystem_type); |
| 24 | |
| 25 | } // namespace cros_disks |
| 26 | |
| 27 | #endif // CROS_DISKS_FILESYSTEM_LABEL_H_ |