# Path: nptdms/common.py
# class ObjectPath(object):
#     def __init__(self, *path_components):
#     def is_root(self):
#     def is_group(self):
#     def is_channel(self):
#     def group_path(self):
#     def from_string(path_string):
#     def __str__(self):
# def _path_components(path):
# def _components_to_path(group, channel):


    from collections import OrderedDict
from datetime import datetime
from io import UnsupportedOperation
from nptdms.common import toc_properties, ObjectPath
from nptdms.types import *
import numpy as np
            num_properties = len(properties)
            metadata.append(Uint32(num_properties))
            for prop_name, prop_value in properties.items():
                metadata.append(String(prop_name))
                metadata.append(Int32(prop_value.enum_value))
                metadata.append(prop_value)
        return metadata

    def raw_data_index(self, obj):
        if hasattr(obj, 'data'):
            data_type = Int32(obj.data_type.enum_value)
            dimension = Uint32(1)
            num_values = Uint64(len(obj.data))

            data_index = [Uint32(20), data_type, dimension, num_values]
            # For strings, we also need to write the total data size in bytes
            if obj.data_type == String:
                total_size = object_data_size(obj.data_type, obj.data)
                data_index.append(Uint64(total_size))

            return data_index
        else:
            return [Bytes(b'\xFF\xFF\xFF\xFF')]

    def leadin(self, toc, metadata_size):
        leadin = []
        leadin.append(Bytes(b'TDSm'))

        toc_mask = long(0)
        for toc_flag in toc:

# Path: nptdms/common.py
# class ObjectPath(object):
#     def __init__(self, *path_components):
#     def is_root(self):
#     def is_group(self):
#     def is_channel(self):
#     def group_path(self):
#     def from_string(path_string):
#     def __str__(self):
# def _path_components(path):
# def _components_to_path(group, channel):


# Path: nptdms/writer.py
    from collections import OrderedDict
from datetime import datetime
from io import UnsupportedOperation
from nptdms.common import toc_properties, ObjectPath
from nptdms.types import *
import numpy as np

            num_properties = len(properties)
            metadata.append(Uint32(num_properties))
            for prop_name, prop_value in properties.items():
                metadata.append(String(prop_name))
                metadata.append(Int32(prop_value.enum_value))
                metadata.append(prop_value)
        return metadata

    def raw_data_index(self, obj):
        if hasattr(obj, 'data'):
            data_type = Int32(obj.data_type.enum_value)
            dimension = Uint32(1)
            num_values = Uint64(len(obj.data))

            data_index = [Uint32(20), data_type, dimension, num_values]
            # For strings, we also need to write the total data size in bytes
            if obj.data_type == String:
                total_size = object_data_size(obj.data_type, obj.data)
                data_index.append(Uint64(total_size))

            return data_index
        else:
            return [Bytes(b'\xFF\xFF\xFF\xFF')]

    def leadin(self, toc, metadata_size):
        leadin = []
        leadin.append(Bytes(b'TDSm'))

        toc_mask = long(0)
        for toc_flag in toc:

            toc_mask = toc_mask | toc_properties[toc_flag]