Exemple #1
0
void AutoIncrementKeyGenerator::track (TRI_voc_key_t key) {
  // check the numeric key part
  uint64_t value = TRI_UInt64String(key);

  if (value > _lastValue) {
    // and update our last value
    _lastValue = value;
  }
}
static void AutoIncrementTrack (TRI_key_generator_t* const generator,
                                const TRI_voc_key_t key) {
  autoincrement_keygen_t* data;
  uint64_t value;

  data = (autoincrement_keygen_t*) generator->_data;
  assert(data != NULL);

  // check the numeric key part
  value = TRI_UInt64String(key);
  if (value > data->_lastValue) {
    // and update our last value
    data->_lastValue = value;
  }
}
Exemple #3
0
uint64_t TRI_UInt64String2 (char const* str, size_t length) {
  char tmp[1024];

  if (str[length] != '\0') {
    if (length >= sizeof(tmp)) {
      length = sizeof(tmp) - 1;
    }

    memcpy(tmp, str, length);
    tmp[length] = '\0';
    str = tmp;
  }

  return TRI_UInt64String(str);
}