yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
message_source_sync.cc File Reference
#include "app/editor/message/message_source_sync.h"
#include <algorithm>
#include <array>
#include <atomic>
#include <cctype>
#include <cerrno>
#include <chrono>
#include <cstdint>
#include <cstring>
#include <exception>
#include <filesystem>
#include <fstream>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <string_view>
#include <system_error>
#include <utility>
#include <vector>
#include "absl/status/status.h"
#include "absl/strings/ascii.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "app/editor/message/message_data.h"
#include "nlohmann/json.hpp"
#include "rom/snes.h"
#include "util/macro.h"
#include <fcntl.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>

Go to the source code of this file.

Classes

struct  yaze::editor::anonymous_namespace{message_source_sync.cc}::ExpandedSourceMessage
 
struct  yaze::editor::anonymous_namespace{message_source_sync.cc}::PublicationArtifact
 
class  yaze::editor::anonymous_namespace{message_source_sync.cc}::MessageSourceWriteLocks
 

Namespaces

namespace  yaze
 
namespace  yaze::editor
 Editors are the view controllers for the application.
 
namespace  yaze::editor::anonymous_namespace{message_source_sync.cc}
 

Typedefs

using yaze::editor::anonymous_namespace{message_source_sync.cc}::Json = nlohmann::json
 
using yaze::editor::anonymous_namespace{message_source_sync.cc}::ExpandedSourceBank = std::map<int, ExpandedSourceMessage>
 

Functions

std::mutex & yaze::editor::anonymous_namespace{message_source_sync.cc}::MessageSourceWriteMutex ()
 
constexpr uint32_t yaze::editor::anonymous_namespace{message_source_sync.cc}::RotateRight (uint32_t value, uint32_t count)
 
void yaze::editor::anonymous_namespace{message_source_sync.cc}::TransformSha256 (uint32_t state[8], const uint8_t block[64])
 
std::string yaze::editor::anonymous_namespace{message_source_sync.cc}::Sha256Hex (std::string_view content)
 
absl::StatusOr< std::string > yaze::editor::anonymous_namespace{message_source_sync.cc}::ReadTextFile (const fs::path &path, absl::string_view label)
 
bool yaze::editor::anonymous_namespace{message_source_sync.cc}::ReadBoundedNonnegativeInteger (const Json &value, uint64_t maximum, uint64_t *parsed)
 
absl::StatusOr< Jsonyaze::editor::anonymous_namespace{message_source_sync.cc}::ParseBundleDocument (std::string_view content, absl::string_view label)
 
absl::StatusOr< std::string > yaze::editor::anonymous_namespace{message_source_sync.cc}::SelectEntryText (const Json &entry, int id, absl::string_view label)
 
std::string yaze::editor::anonymous_namespace{message_source_sync.cc}::NormalizeLegacyDictionaryTokens (std::string text)
 
absl::StatusOr< ExpandedSourceBankyaze::editor::anonymous_namespace{message_source_sync.cc}::ParseExpandedBank (const Json &document, int expected_count, bool require_complete, absl::string_view label)
 
std::string yaze::editor::anonymous_namespace{message_source_sync.cc}::SerializeCanonicalBundle (const ExpandedSourceBank &bank)
 
std::string yaze::editor::anonymous_namespace{message_source_sync.cc}::RenderAsmBody (const ExpandedSourceBank &bank, int first_expanded_id)
 
std::string yaze::editor::anonymous_namespace{message_source_sync.cc}::RenderAsmInclude (const ExpandedSourceBank &bank, int first_expanded_id, std::string_view source_sha256)
 
bool yaze::editor::anonymous_namespace{message_source_sync.cc}::IsCanonicalMappedLoRomAddress (uint32_t address)
 
absl::StatusOr< size_t > yaze::editor::anonymous_namespace{message_source_sync.cc}::ValidateLayoutAndGetCapacity (const core::MessageLayout &layout)
 
bool yaze::editor::anonymous_namespace{message_source_sync.cc}::IsWithinRoot (const fs::path &root, const fs::path &candidate)
 
absl::StatusOr< fs::path > yaze::editor::anonymous_namespace{message_source_sync.cc}::ResolveProjectTarget (const fs::path &project_root, const std::string &configured_path, bool must_exist, absl::string_view label)
 
absl::StatusOr< fs::path > yaze::editor::anonymous_namespace{message_source_sync.cc}::CanonicalProjectRoot (const project::YazeProject &project)
 
std::string yaze::editor::anonymous_namespace{message_source_sync.cc}::LowercasePath (const fs::path &path)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::ValidateDistinctTargets (const fs::path &bundle_path, const fs::path &include_path)
 
absl::StatusOr< std::vector< fs::path > > yaze::editor::anonymous_namespace{message_source_sync.cc}::PublicationLockPaths (const fs::path &bundle_path, const fs::path &include_path)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::ValidateTargetsDoNotAliasLocks (const std::vector< fs::path > &lock_paths, const fs::path &bundle_path, const fs::path &include_path)
 
fs::path yaze::editor::anonymous_namespace{message_source_sync.cc}::NextSiblingPath (const fs::path &target, absl::string_view purpose)
 
absl::StatusOr< fs::path > yaze::editor::anonymous_namespace{message_source_sync.cc}::WriteExclusiveTemp (const fs::path &target, std::string_view content)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::SyncParentDirectory (const fs::path &target)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::ReplaceFromTemp (const fs::path &temp, const fs::path &target, bool *replaced=nullptr)
 
absl::StatusOr< fs::path > yaze::editor::anonymous_namespace{message_source_sync.cc}::CreateBackup (const fs::path &target)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::CleanupPublicationPaths (const std::vector< fs::path > &paths, absl::string_view artifact_kind)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::CleanupTemps (const std::vector< PublicationArtifact > &artifacts)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::CleanupBackups (std::vector< PublicationArtifact > *artifacts)
 
std::string yaze::editor::anonymous_namespace{message_source_sync.cc}::BackupRecoveryPaths (const std::vector< PublicationArtifact > &artifacts)
 
std::string yaze::editor::anonymous_namespace{message_source_sync.cc}::CleanupStatusSummary (const absl::Status &status)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::ReturnFailureAfterCleanup (std::vector< PublicationArtifact > *artifacts, const absl::Status &publication_failure)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::RestoreArtifact (const PublicationArtifact &artifact)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::RollBackPublication (std::vector< PublicationArtifact > *artifacts, const absl::Status &publication_failure)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::VerifyUnchangedBeforePublication (const std::vector< PublicationArtifact > &artifacts, std::string_view expected_source_sha256)
 
absl::Status yaze::editor::anonymous_namespace{message_source_sync.cc}::PublishArtifactSet (std::vector< PublicationArtifact > *artifacts, std::string_view expected_source_sha256)
 
absl::StatusOr< std::string > yaze::editor::anonymous_namespace{message_source_sync.cc}::NormalizeExpectedSha256 (std::string hash)
 
std::string yaze::editor::ComputeMessageSourceSha256 (std::string_view content)
 
absl::StatusOr< MessageSourceSyncResultyaze::editor::SyncMessageSource (const project::YazeProject &project, const fs::path &incoming_bundle_path, const MessageSourceSyncOptions &options)
 

Variables

constexpr char yaze::editor::anonymous_namespace{message_source_sync.cc}::kSourceSyncLockBasename [] = ".yaze-message-source-sync.lock"
 
constexpr uint32_t yaze::editor::anonymous_namespace{message_source_sync.cc}::kSha256Constants [64]